![]() |
Stan Math Library
4.2.1
Automatic Differentiation
|
Matrices and templated mathematical functions.
Templated probability distributions. All paramaterizations are based on Bayesian Data Analysis. Function gradients via reverse-mode automatic differentiation.
Namespaces | |
| internal | |
Returns the elementwise abs() of the input, which may be a scalar or any Stan container of numeric scalars. | |
| opencl | |
| opencl_kernels | |
Classes | |
| struct | abs_fun |
| Return elementwise absolute value of the specified real-valued container. More... | |
| class | accumulator |
| Class to accumulate values and eventually return their sum. More... | |
| class | accumulator< T, require_var_t< T > > |
| Class to accumulate values and eventually return their sum. More... | |
| class | acos_ |
| struct | acos_fun |
Structure to wrap acos() so it can be vectorized. More... | |
| class | acosh_ |
| struct | acosh_fun |
| Structure to wrap acosh() so it can be vectorized. More... | |
| struct | ad_promotable |
| If the type From can be converted to To using implicit conversions, or both From and To are possibly cv-qualified void), provides the member constant value equal to true. More... | |
| class | ad_tape_observer |
| TBB observer object which is a callback hook called whenever the TBB scheduler adds a new thread to the TBB managed threadpool. More... | |
| class | addition_ |
| class | addition_operator_ |
| class | adjoint_results_cl |
| Represents results that are adjoints of vars in kernel generrator expressions. More... | |
| class | append_col_ |
| Represents appending of cols in kernel generator expressions. More... | |
| struct | append_return_type |
| This template metaprogram is used to compute the return type for append_array. More... | |
| struct | append_return_type< Eigen::Matrix< T1, R, C >, Eigen::Matrix< T2, R, C > > |
| This template metaprogram is used to compute the return type for append_array. More... | |
| struct | append_return_type< int, int > |
| This template metaprogram is used to compute the return type for append_array. More... | |
| struct | append_return_type< std::vector< T1 >, std::vector< T2 > > |
| This template metaprogram is used to compute the return type for append_array. More... | |
| class | append_row_ |
| Represents appending of rows in kernel generator expressions. More... | |
| struct | apply_scalar_unary |
Base template class for vectorization of unary scalar functions defined by a template class F to a scalar, standard library vector, or Eigen dense matrix expression template. More... | |
| struct | apply_scalar_unary< F, fvar< T > > |
| Template specialization to fvar for vectorizing a unary scalar function. More... | |
| struct | apply_scalar_unary< F, std::vector< T > > |
| Template specialization for vectorized functions applying to standard vector containers. More... | |
| struct | apply_scalar_unary< F, T, require_complex_t< T > > |
| Template specialization for vectorized functions applying to complex arguments. More... | |
| struct | apply_scalar_unary< F, T, require_eigen_t< T > > |
| Template specialization for vectorized functions applying to Eigen matrix arguments. More... | |
| struct | apply_scalar_unary< F, T, require_floating_point_t< T > > |
| Template specialization for vectorized functions applying to double arguments. More... | |
| struct | apply_scalar_unary< F, T, require_integral_t< T > > |
| Template specialization for vectorized functions applying to integer arguments. More... | |
| struct | apply_scalar_unary< F, T, require_var_matrix_t< T > > |
| struct | apply_scalar_unary< F, var > |
| Template specialization to var for vectorizing a unary scalar function. More... | |
| struct | apply_vector_unary |
| struct | apply_vector_unary< T, require_eigen_t< T > > |
| Base template class for vectorization of unary vector functions defined by applying a functor to a standard library vector, Eigen dense matrix expression template, or container of these. More... | |
| struct | apply_vector_unary< T, require_std_vector_vt< is_container_or_var_matrix, T > > |
| Specialisation for use with nested containers (std::vectors). More... | |
| struct | apply_vector_unary< T, require_std_vector_vt< is_stan_scalar, T > > |
| Specialisation for use with (non-nested) std::vectors. More... | |
| struct | apply_vector_unary< T, require_var_matrix_t< T > > |
Specialisation for use with var_value<T> types where T inherits from EigenBase. More... | |
| struct | arena_allocator |
| std library compatible allocator that uses AD stack. More... | |
| class | arena_matrix |
Equivalent to Eigen::Matrix, except that the data is stored on AD stack. More... | |
| class | arena_matrix_cl |
A variant of matrix_cl that schedules its destructor to be called, so it can be used on the AD stack. More... | |
| class | array_builder |
| Structure for building up arrays in an expression (rather than in statements) using an argument-chaining add() method and a getter method array() to return the result. More... | |
| class | as_column_vector_or_scalar_ |
| Represents as_column_vector_or_scalar of a row or column vector in kernel generator expressions. More... | |
| class | asin_ |
| struct | asin_fun |
Structure to wrap asin() so it can be vectorized. More... | |
| class | asinh_ |
| struct | asinh_fun |
Structure to wrap asinh() so it can be vectorized. More... | |
| class | atan_ |
| struct | atan_fun |
Structure to wrap atan() so it can be vectorized. More... | |
| class | atanh_ |
| struct | atanh_fun |
| Structure to wrap atanh() so it can be vectorized. More... | |
| struct | AutodiffStackSingleton |
| This struct always provides access to the autodiff stack using the singleton pattern. More... | |
| class | beta_ |
| class | binary_operation |
| Represents a binary operation in kernel generator expressions. More... | |
| class | binomial_coefficient_log_ |
| class | block_ |
| Represents submatrix block in kernel generator expressions. More... | |
| class | broadcast_ |
| Represents a broadcasting operation in kernel generator expressions. More... | |
| class | calc_if_ |
| Represents a calc_if in kernel generator expressions. More... | |
| class | cast_ |
| Represents a typecast os scalar in kernel generator expressions. More... | |
| class | cbrt_ |
| struct | cbrt_fun |
Structure to wrap cbrt() so it can be vectorized. More... | |
| class | ceil_ |
| struct | ceil_fun |
Structure to wrap ceil() so it can be vectorized. More... | |
| class | chainable_alloc |
| A chainable_alloc is an object which is constructed and destructed normally but the memory lifespan is managed along with the arena allocator for the gradient calculation. More... | |
| class | chainable_object |
chainable_object hold another object is useful for connecting the lifetime of a specific object to the chainable stack More... | |
| class | check_cl_ |
| Represents a check in kernel generator expressions. More... | |
| struct | child_type |
| Primary template class for metaprogram to compute child type of T. More... | |
| struct | child_type< T_struct< T_child > > |
| Specialization for template classes / structs. More... | |
| class | col_index |
| Represents operation that determines column index. More... | |
| class | colwise_max_ |
| Represents column wise max - reduction in kernel generator expressions. More... | |
| class | colwise_min_ |
| Represents column wise min - reduction in kernel generator expressions. More... | |
| class | colwise_prod_ |
| Represents column wise product - reduction in kernel generator expressions. More... | |
| class | colwise_reduction |
| Represents a column wise reduction in kernel generator expressions. More... | |
| class | colwise_sum_ |
| Represents column wise sum - reduction in kernel generator expressions. More... | |
| class | complex_base |
| Base class for complex numbers. More... | |
| struct | conjunction |
| Extends std::true_type when instantiated with zero or more template parameters, all of which extend the std::true_type. More... | |
| struct | conjunction< T, Ts... > |
| class | constant_ |
| Represents a matrix of single repeated value in kernel generator expressions. More... | |
| class | copysign_ |
| class | cos_ |
| struct | cos_fun |
Structure to wrap cos() so it can be vectorized. More... | |
| class | cosh_ |
| struct | cosh_fun |
Structure to wrap cosh() so it can be vectorized. More... | |
| struct | coupled_ode_system |
| struct | coupled_ode_system_impl |
| struct | coupled_ode_system_impl< false, F, T_y0, Args... > |
The coupled_ode_system_impl template specialization when the state or parameters are autodiff types. More... | |
| struct | coupled_ode_system_impl< true, F, T_y0, Args... > |
The coupled_ode_system_impl for arithmetic arguments reduces to the regular ode system (there are no sensitivities) More... | |
| class | cov_exp_quad_vari |
| class | cov_exp_quad_vari< T_x, double, T_l > |
| class | cvodes_integrator |
| Integrator interface for CVODES' ODE solvers (Adams & BDF methods). More... | |
| class | cvodes_integrator_adjoint_vari |
| Integrator interface for CVODES' adjoint ODE solvers (Adams & BDF methods). More... | |
| class | diagonal_ |
| Represents diagonal of a matrix (as column vector) in kernel generator expressions. More... | |
| class | digamma_ |
| struct | digamma_fun |
| Structure to wrap digamma() so it can be vectorized. More... | |
| struct | disjunction |
| Extends std::false_type when instantiated with zero or more template parameters, all of which extend the std::false_type. More... | |
| struct | disjunction< Cond, Conds... > |
| class | elt_divide_ |
| class | elt_function_cl |
| Represents an element-wise function in kernel generator expressions. More... | |
| class | elt_modulo_ |
| class | elt_multiply_ |
| class | equals_ |
| class | erf_ |
| struct | erf_fun |
Structure to wrap erf() so it can be vectorized. More... | |
| class | erfc_ |
| struct | erfc_fun |
Structure to wrap the erfc() so that it can be vectorized. More... | |
| class | exp2_ |
| struct | exp2_fun |
Structure to wrap exp2() so it can be vectorized. More... | |
| class | exp_ |
| struct | exp_fun |
Structure to wrap exp() so that it can be vectorized. More... | |
| class | expm1_ |
| struct | expm1_fun |
Structure to wrap expm1() so that it can be vectorized. More... | |
| class | expressions_cl |
| Represents multiple expressions that will be calculated in same kernel. More... | |
| class | fabs_ |
| struct | fabs_fun |
Structure to wrap fabs() so that it can be vectorized. More... | |
| class | fdim_ |
| struct | FixedPointADJac |
| Calculate Jacobian Jxy(Jacobian of unknown x w.r.t. More... | |
| struct | FixedPointSolver |
| Fixed point solver for problem of form. More... | |
| struct | FixedPointSolver< KinsolFixedPointEnv< F >, fp_jac_type > |
| Specialization for fixed point solver when using KINSOL. More... | |
| class | floor_ |
| struct | floor_fun |
Structure to wrap floor() so that it can be vectorized. More... | |
| class | fmax_ |
| class | fmin_ |
| class | fmod_ |
| struct | fvar |
| This template class represents scalars used in forward-mode automatic differentiation, which consist of values and directional derivatives of the specified template type. More... | |
| class | gevv_vvv_vari |
| class | greater_than_ |
| class | greater_than_or_equal_ |
| class | Holder |
| A no-op Eigen operation. More... | |
| class | holder_cl_ |
| Represents a no-op in kernel generator expressions. More... | |
| struct | hybrj_functor_solver |
| A functor with the required operators to call Eigen's algebraic solver. More... | |
| class | hypot_ |
| class | idas_forward_system |
| IDAS DAE system with forward sensitivity calculation. More... | |
| class | idas_integrator |
| IDAS DAE integrator. More... | |
| class | idas_system |
| IDAS DAE system that contains information on residual equation functor, sensitivity residual equation functor, as well as initial conditions. More... | |
| struct | include_summand |
| Template metaprogram to calculate whether a summand needs to be included in a proportional (log) probability calculation. More... | |
| struct | include_summand< propto, T > |
true if a term with the specified propto value and subterm types should be included in a proportionality calculation. More... | |
| struct | index_type |
| Primary template class for the metaprogram to compute the index type of a container. More... | |
| struct | index_type< T, require_eigen_t< T > > |
| Template metaprogram defining typedef for the type of index for an Eigen matrix, vector, or row vector. More... | |
| struct | index_type< T, require_std_vector_t< T > > |
| Template metaprogram class to compute the type of index for a standard vector. More... | |
| struct | index_type< T, std::enable_if_t< std::is_pointer< T >::value > > |
| Specialization of index_type for pointers. More... | |
| class | indexing_ |
| Represents indexing of a matrix with two matrices of indices. More... | |
| struct | inv_cloglog_fun |
| Structure to wrap inv_cloglog() so that it can be vectorized. More... | |
| struct | inv_fun |
| Structure to wrap 1.0 / x so that it can be vectorized. More... | |
| class | inv_logit_ |
| struct | inv_logit_fun |
| Structure to wrap inv_logit() so that it can be vectorized. More... | |
| class | inv_Phi_ |
| struct | inv_Phi_fun |
| Structure to wrap inv_Phi() so it can be vectorized. More... | |
| struct | inv_sqrt_fun |
Structure to wrap 1 / sqrt(x) so that it can be vectorized. More... | |
| class | inv_square_ |
| class | isfinite_ |
| class | isinf_ |
| class | isnan_ |
| struct | kernel_parts |
| Parts of an OpenCL kernel, generated by an expression. More... | |
| class | kinsol_system_data |
| KINSOL algebraic system data holder. More... | |
| struct | KinsolFixedPointEnv |
| KINSOL algebraic system data holder that handles construction & destruction of SUNDIALS data, as well as auxiliary data that will be used for functor evaluation. More... | |
| class | lbeta_ |
| class | ldexp_ |
| class | LDLT_factor |
| LDLT_factor is a structure that holds a matrix of type T and the LDLT of its values. More... | |
| class | LDLT_factor< T, require_eigen_matrix_dynamic_vt< is_var, T > > |
An LDLT_factor of an Eigen::Matrix<var, Eigen::Dynamic, Eigen::Dynamic> with alloc_in_arena = True holds a copy of the input matrix and the LDLT of its values, with all member variable allocations are done in the arena. More... | |
| class | LDLT_factor< T, require_var_matrix_t< T > > |
An LDLT_factor of a var_value<Eigen::MatrixXd> holds a copy of the input var_value and the LDLT of its values. More... | |
| class | LDLT_factor< T, std::enable_if_t< bool_constant< is_eigen_matrix_dynamic< T >::value &&!is_var< scalar_type_t< T > >::value >::value > > |
| An LDLT_factor is a structure that holds a matrix of type T and the LDLT of its values. More... | |
| class | less_than_ |
| class | less_than_or_equal_ |
| class | lgamma_ |
| struct | lgamma_fun |
| Structure to wrap lgamma() so that it can be vectorized. More... | |
| class | lmultiply_ |
| class | load_ |
Represents an access to a matrix_cl in kernel generator expressions. More... | |
| class | log10_ |
| struct | log10_fun |
| Structure to wrap log10() so it can be vectorized. More... | |
| class | log1m_ |
| class | log1m_exp_ |
| struct | log1m_exp_fun |
| Structure to wrap log1m_exp() so it can be vectorized. More... | |
| struct | log1m_fun |
| Structure to wrap log1m() so it can be vectorized. More... | |
| class | log1m_inv_logit_ |
| struct | log1m_inv_logit_fun |
| Structure to wrap log1m_inv_logit() so it can be vectorized. More... | |
| class | log1p_ |
| class | log1p_exp_ |
| struct | log1p_exp_fun |
| Structure to wrap log1p_exp() so that it can be vectorized. More... | |
| struct | log1p_fun |
| Structure to wrap log1p() so it can be vectorized. More... | |
| class | log2_ |
| struct | log2_fun |
Structure to wrap log2() so it can be vectorized. More... | |
| class | log_ |
| class | log_diff_exp_ |
| struct | log_fun |
Structure to wrap log() so that it can be vectorized. More... | |
| class | log_inv_logit_ |
| class | log_inv_logit_diff_ |
| struct | log_inv_logit_fun |
| Structure to wrap log_inv_logit() so it can be vectorized. More... | |
| class | logical_and_ |
| class | logical_negation_ |
| Represents a logical negation in kernel generator expressions. More... | |
| class | logical_or_ |
| class | logit_ |
| struct | logit_fun |
| Structure to wrap logit() so it can be vectorized. More... | |
| class | matrix_cl |
| Represents an arithmetic matrix on the OpenCL device. More... | |
| class | matrix_cl_base |
Non-templated base class for matrix_cl simplifies checking if something is matrix_cl. More... | |
| class | matrix_exp_action_handler |
| The implementation of the work by Awad H. More... | |
| class | max_2d_ |
| Represents two dimensional max - reduction in kernel generator expressions. More... | |
| struct | max_op |
| Operation for max reduction. More... | |
| class | min_2d_ |
| Represents two dimensional min - reduction in kernel generator expressions. More... | |
| struct | min_op |
| Operation for min reduction. More... | |
| struct | mpi_cluster |
| MPI cluster holds MPI resources and must be initialized only once in any MPI program. More... | |
| struct | mpi_command |
| A MPI command object is used to execute code on worker nodes. More... | |
| struct | mpi_distributed_apply |
| MPI command template which calls the static method distributed_apply of the given class F. More... | |
| class | mpi_is_in_use |
| Exception thrown whenever the MPI resource is busy. More... | |
| class | mpi_parallel_call |
| The MPI parallel call class manages the distributed evaluation of a collection of tasks following the map - reduce - combine pattern. More... | |
| class | mpi_stop_listen |
| Exception used to stop workers nodes from further listening to commands send from the root. More... | |
| struct | mpi_stop_worker |
| MPI command used to stop childs nodes from listening for further commands. More... | |
| class | multiply_log_ |
| class | name_generator |
| Unique name generator for variables used in generated kernels. More... | |
| class | nested_rev_autodiff |
| A class following the RAII idiom to start and recover nested autodiff scopes. More... | |
| struct | nlo_functor |
| A structure which gets passed to Eigen's dogleg algebraic solver. More... | |
| class | not_equals_ |
| class | op_ddv_vari |
| class | op_dv_vari |
| class | op_dvd_vari |
| class | op_dvv_vari |
| class | op_matrix_vari |
| class | op_v_vari |
| class | op_vd_vari |
| class | op_vdd_vari |
| class | op_vdv_vari |
| class | op_vector_vari |
| class | op_vv_vari |
| class | op_vvd_vari |
| class | op_vvv_vari |
| class | opencl_code_ |
| Represents custom code in kernel generator expressions. More... | |
| class | opencl_code_output |
| Represents output variable of custom code in kernel generator expressions. More... | |
| class | opencl_context |
| The API to access the methods and values in opencl_context_base. More... | |
| class | opencl_context_base |
The opencl_context_base class represents an OpenCL context in the standard Meyers singleton design pattern. More... | |
| class | operands_and_partials |
| This template builds partial derivatives with respect to a set of operands. More... | |
| class | operands_and_partials< Op1, Op2, Op3, Op4, Op5, fvar< Dx > > |
| This class builds partial derivatives with respect to a set of operands. More... | |
| class | operands_and_partials< Op1, Op2, Op3, Op4, Op5, var > |
| This class builds partial derivatives with respect to a set of operands. More... | |
| class | operation_cl |
| Base for all kernel generator operations. More... | |
| class | operation_cl_lhs |
| Base for all kernel generator operations that can be used on left hand side of an expression. More... | |
| class | optional_broadcast_ |
| Represents an optional broadcasting operation in kernel generator expressions. More... | |
| struct | pass_type |
| struct | pass_type< double > |
| struct | pass_type< int > |
| class | Phi_ |
| class | Phi_approx_ |
| struct | Phi_approx_fun |
| Structure to wrap Phi_approx() so it can be vectorized. More... | |
| struct | Phi_fun |
| Structure to wrap Phi() so it can be vectorized. More... | |
| class | pinned_matrix |
Equivalent to Eigen::Matrix, except that the data is stored in (hopefully pinned) memory, allocated by OpenCL driver. More... | |
| class | pow_ |
| class | precomp_vv_vari |
| class | precomp_vvv_vari |
| class | precomputed_gradients_vari_template |
| A variable implementation taking a sequence of operands and partial derivatives with respect to the operands. More... | |
| class | prod_2d_ |
| Represents two dimensional product - reduction in kernel generator expressions. More... | |
| struct | prod_op |
| Operation for product reduction. More... | |
| class | profile |
| Profiles C++ lines where the object is in scope. More... | |
| class | profile_info |
| Class used for storing profiling information. More... | |
| struct | promote_elements |
| Struct with static function for elementwise type promotion. More... | |
| struct | promote_elements< Eigen::Matrix< T, R, C >, Eigen::Matrix< S, R, C > > |
| Struct with static function for elementwise type promotion. More... | |
| struct | promote_elements< Eigen::Matrix< T, R, C >, Eigen::Matrix< T, R, C > > |
| Struct with static function for elementwise type promotion. More... | |
| struct | promote_elements< std::vector< T >, std::vector< S > > |
| Struct with static function for elementwise type promotion. More... | |
| struct | promote_elements< std::vector< T >, std::vector< T > > |
| Struct with static function for elementwise type promotion. More... | |
| struct | promote_elements< T, T > |
| Struct with static function for elementwise type promotion. More... | |
| struct | promote_scalar_struct |
| General struct to hold static function for promoting underlying scalar types. More... | |
| struct | promote_scalar_struct< T, S, require_eigen_t< S > > |
| Struct to hold static function for promoting underlying scalar types. More... | |
| struct | promote_scalar_struct< T, std::vector< S > > |
| Struct to hold static function for promoting underlying scalar types. More... | |
| struct | promote_scalar_struct< T, T > |
| Struct to hold static function for promoting underlying scalar types. More... | |
| struct | promote_scalar_type |
| Template metaprogram to calculate a type for converting a convertible type. More... | |
| struct | promote_scalar_type< T, S, require_all_t< is_var< T >, is_var< S >, is_eigen< value_type_t< S > > > > |
Specialization for var_value when the type to convert to is a var_value. More... | |
| struct | promote_scalar_type< T, S, require_all_t< std::is_arithmetic< T >, is_var< S >, is_eigen< value_type_t< S > > > > |
Specialization for var_value when the type to convert to is arithmetic. More... | |
| struct | promote_scalar_type< T, S, require_eigen_t< S > > |
| Template metaprogram to calculate a type for a matrix, vector, row vector or Eigen::Array whose underlying scalar is converted from the second template parameter type to the first. More... | |
| struct | promote_scalar_type< T, std::vector< S > > |
| Template metaprogram to calculate a type for a container whose underlying scalar is converted from the second template parameter type to the first. More... | |
| class | read_fvar_functor |
| Functor for extracting the values and tangents from a matrix of fvar. More... | |
| class | reduction_2d |
| Represents a two dimensional reduction in kernel generator expressions. More... | |
| struct | ref_type_for_opencl |
| Determines appropriate type for assigning expression of given type to, so that the resulting type has directly accessible contiguous colum-major data, which is needed to copy to OpenCL device for construction of matrix_cl. More... | |
| struct | ref_type_for_opencl< T, require_arena_matrix_t< T > > |
| struct | ref_type_for_opencl< T, require_not_eigen_t< T > > |
| class | results_cl |
| Represents results that will be calculated in same kernel. More... | |
| class | round_ |
| struct | round_fun |
Structure to wrap round() so it can be vectorized. More... | |
| class | row_index |
| Represents operation that determines row index. More... | |
| class | rowwise_max_ |
| Represents rowwise max reduction in kernel generator expressions. More... | |
| class | rowwise_min_ |
| Represents rowwise min reduction in kernel generator expressions. More... | |
| class | rowwise_prod_ |
| Represents rowwise product reduction in kernel generator expressions. More... | |
| class | rowwise_reduction |
| Represents a rowwise reduction in kernel generator expressions. More... | |
| class | rowwise_sum_ |
| Represents rowwise sum reduction in kernel generator expressions. More... | |
| class | rsqrt_ |
| class | scalar_ |
| Represents a scalar in kernel generator expressions. More... | |
| class | ScopedChainableStack |
| The AD tape of reverse mode AD is by default stored globally within the process (or thread). More... | |
| class | select_ |
| Represents a selection operation in kernel generator expressions. More... | |
| class | seq_view |
| class | seq_view< double, std::vector< int > > |
| class | seq_view< T, Eigen::Matrix< S, 1, Eigen::Dynamic > > |
| class | seq_view< T, Eigen::Matrix< S, Eigen::Dynamic, 1 > > |
| class | seq_view< T, Eigen::Matrix< S, Eigen::Dynamic, Eigen::Dynamic > > |
| class | seq_view< T, std::vector< S > > |
| class | seq_view< T, std::vector< std::vector< T > > > |
| class | seq_view< T, std::vector< T > > |
| struct | sign_fun |
Structure to wrap sign() so it can be vectorized. More... | |
| class | sin_ |
| struct | sin_fun |
| Structure to wrap sin() so it can be vectorized. More... | |
| class | sinh_ |
| struct | sinh_fun |
| Structure to wrap sinh() so that it can be vectorized. More... | |
| class | sqrt_ |
| struct | sqrt_fun |
Structure to wrap sqrt() so that it can be vectorized. More... | |
| class | square_ |
| struct | square_fun |
| Structure to wrap square() so that it can be vectorized. More... | |
| class | stack_alloc |
| An instance of this class provides a memory pool through which blocks of raw memory may be allocated and then collected simultaneously. More... | |
| struct | step_fun |
Structure to wrap step() so it can be vectorized. More... | |
| struct | store_type |
| struct | store_type< double > |
| struct | store_type< int > |
| class | stored_gradient_vari |
| A var implementation that stores the daughter variable implementation pointers and the partial derivative with respect to the result explicitly in arrays constructed on the autodiff memory stack. More... | |
| class | subtraction_ |
| class | subtraction_operator_ |
| class | sum_2d_ |
| Represents two dimensional sum - reduction in kernel generator expressions. More... | |
| struct | sum_op |
| Operation for sum reduction. More... | |
| class | tan_ |
| struct | tan_fun |
Structure to wrap tan() so that it can be vectorized. More... | |
| class | tanh_ |
| struct | tanh_fun |
Structure to wrap tanh() so that it can be vectorized. More... | |
| class | tgamma_ |
| struct | tgamma_fun |
| Structure to wrap tgamma() so that it can be vectorized. More... | |
| class | transpose_ |
| Represents a transpose in kernel generator expressions. More... | |
| class | trigamma_ |
| struct | trigamma_fun |
Structure to wrap trigamma() so it can be vectorized. More... | |
| class | trunc_ |
| struct | trunc_fun |
Structure to wrap trunc() so it can be vectorized. More... | |
| class | unary_minus_ |
| Represents an unary minus operation in kernel generator expressions. More... | |
| class | unary_operation_cl |
| Represents a unary operation in kernel generator expressions. More... | |
| class | unsafe_chainable_object |
unsafe_chainable_object hold another object and is useful for connecting the lifetime of a specific object to the chainable stack. More... | |
| class | val_adj_functor |
| Functor for extracting the values and adjoints from a matrix of var or vari. More... | |
| class | var_value |
| class | var_value< T, internal::require_matrix_var_value< T > > |
| Independent (input) and dependent (output) variables for gradients. More... | |
| class | var_value< T, require_floating_point_t< T > > |
| Independent (input) and dependent (output) variables for gradients. More... | |
| class | vari_base |
Abstract base class that all vari_value and it's derived classes inherit. More... | |
| class | vari_cl_base |
| class | vari_value |
| class | vari_value< T, require_all_t< is_plain_type< T >, is_eigen_dense_base< T > > > |
| The variable implementation for Eigen dense matrix types. More... | |
| class | vari_value< T, require_eigen_sparse_base_t< T > > |
| The variable implementation for Eigen sparse matrix types. More... | |
| class | vari_value< T, require_matrix_cl_t< T > > |
The variable implementation for matrix_cl. More... | |
| class | vari_value< T, require_t< std::is_floating_point< T > > > |
| The variable implementation for floating point types. More... | |
| class | vari_view |
A vari_view is used to read from a slice of a vari_value with an inner eigen type. More... | |
| class | vari_view< T, require_all_t< is_eigen< T >, bool_constant<!is_plain_type< T >::value > > > |
| class | vari_view< T, require_kernel_expression_lhs_t< T > > |
| class | vari_view_eigen |
This struct is follows the CRTP for methods common to vari_view<> and vari_value<Matrix>. More... | |
| class | vi_adj_functor |
| Functor for extracting the varis and adjoints from a matrix of var. More... | |
| class | vi_val_adj_functor |
| Functor for extracting the vari*, values, and adjoints from a matrix of var. More... | |
| class | vi_val_functor |
| Functor for extracting the varis and values from a matrix of var. More... | |
| class | welford_covar_estimator |
| class | welford_var_estimator |
Typedefs | |
| using | size_type = Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index |
| Type for sizes and indexes in an Eigen matrix with double elements. More... | |
| using | matrix_fd = Eigen::Matrix< fvar< double >, Eigen::Dynamic, Eigen::Dynamic > |
| using | matrix_ffd = Eigen::Matrix< fvar< fvar< double > >, Eigen::Dynamic, Eigen::Dynamic > |
| using | vector_fd = Eigen::Matrix< fvar< double >, Eigen::Dynamic, 1 > |
| using | vector_ffd = Eigen::Matrix< fvar< fvar< double > >, Eigen::Dynamic, 1 > |
| using | row_vector_fd = Eigen::Matrix< fvar< double >, 1, Eigen::Dynamic > |
| using | row_vector_ffd = Eigen::Matrix< fvar< fvar< double > >, 1, Eigen::Dynamic > |
| using | matrix_fv = Eigen::Matrix< fvar< var >, Eigen::Dynamic, Eigen::Dynamic > |
| using | matrix_ffv = Eigen::Matrix< fvar< fvar< var >>, Eigen::Dynamic, Eigen::Dynamic > |
| using | vector_fv = Eigen::Matrix< fvar< var >, Eigen::Dynamic, 1 > |
| using | vector_ffv = Eigen::Matrix< fvar< fvar< var >>, Eigen::Dynamic, 1 > |
| using | row_vector_fv = Eigen::Matrix< fvar< var >, 1, Eigen::Dynamic > |
| using | row_vector_ffv = Eigen::Matrix< fvar< fvar< var >>, 1, Eigen::Dynamic > |
| template<typename T > | |
| using | as_operation_cl_t = std::conditional_t< std::is_lvalue_reference< T >::value, decltype(as_operation_cl(std::declval< T >())), std::remove_reference_t< decltype(as_operation_cl(std::declval< T >()))>> |
| Type that results when converting any valid kernel generator expression into operation. More... | |
| template<typename T > | |
| using | is_without_output = internal::is_without_output_impl< std::decay_t< T >> |
| template<typename T > | |
| using | is_colwise_reduction = internal::is_colwise_reduction_impl< std::decay_t< T >> |
| Check whether a kernel generator expression is a colwise reduction. More... | |
| template<typename... Types> | |
| using | common_scalar_t = typename std::common_type_t< typename std::remove_reference_t< Types >::Scalar... > |
Wrapper for std::common_type_t More... | |
| template<typename T > | |
| using | is_reduction_2d = internal::is_reduction_2d_impl< std::decay_t< T >> |
| Check whether a kernel generator expression is a colwise reduction. More... | |
| template<typename T > | |
| using | ref_type_for_opencl_t = typename ref_type_for_opencl< T >::type |
| template<int B = 0> | |
| using | boost_policy_t = boost::math::policies::policy< boost::math::policies::overflow_error< boost::math::policies::errno_on_error >, boost::math::policies::pole_error< boost::math::policies::errno_on_error >, boost::math::policies::promote_double< false >, boost::math::policies::digits2< B >> |
| Boost policy that overrides the defaults to match the built-in C++ standard library functions. More... | |
| using | matrix_d = Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > |
| Type for matrix of double values. More... | |
| using | vector_d = Eigen::Matrix< double, Eigen::Dynamic, 1 > |
| Type for (column) vector of double values. More... | |
| using | row_vector_d = Eigen::Matrix< double, 1, Eigen::Dynamic > |
| Type for (row) vector of double values. More... | |
| template<typename T > | |
| using | index_type_t = typename index_type< T >::type |
| Type for sizes and indexes in an Eigen matrix with double elements. More... | |
| template<typename T , typename S > | |
| using | promote_scalar_t = typename promote_scalar_type< std::decay_t< T >, std::decay_t< S >>::type |
| using | ChainableStack = AutodiffStackSingleton< vari_base, chainable_alloc > |
| using | precomputed_gradients_vari = precomputed_gradients_vari_template< std::tuple<>, std::tuple<>> |
| using | profile_key = std::pair< std::string, std::thread::id > |
| using | profile_map = std::map< profile_key, profile_info > |
| using | matrix_v = Eigen::Matrix< var, Eigen::Dynamic, Eigen::Dynamic > |
The type of a matrix holding var values. More... | |
| using | vector_v = Eigen::Matrix< var, Eigen::Dynamic, 1 > |
The type of a (column) vector holding var values. More... | |
| using | row_vector_v = Eigen::Matrix< var, 1, Eigen::Dynamic > |
The type of a row vector holding var values. More... | |
| using | matrix_vi = Eigen::Matrix< vari *, Eigen::Dynamic, Eigen::Dynamic > |
The type of a matrix holding vari* values. More... | |
| using | vector_vi = Eigen::Matrix< vari *, Eigen::Dynamic, 1 > |
The type of a (column) vector holding vari* values. More... | |
| using | row_vector_vi = Eigen::Matrix< vari *, 1, Eigen::Dynamic > |
The type of a row vector holding vari* values. More... | |
| using | var = var_value< double > |
| using | vari = vari_value< double > |
Enumerations | |
| enum | matrix_cl_view { matrix_cl_view::Diagonal = 0, matrix_cl_view::Lower = 1, matrix_cl_view::Upper = 2, matrix_cl_view::Entire = 3 } |
Functions | |
| template<typename T > | |
| fvar< T > | operator+ (const fvar< T > &x1, const fvar< T > &x2) |
| Return the sum of the specified forward mode addends. More... | |
| template<typename T > | |
| fvar< T > | operator+ (double x1, const fvar< T > &x2) |
| Return the sum of the specified double and forward mode addends. More... | |
| template<typename T > | |
| fvar< T > | operator+ (const fvar< T > &x1, double x2) |
| Return the sum of the specified forward mode and double addends. More... | |
| template<typename T > | |
| fvar< T > | operator/ (const fvar< T > &x1, const fvar< T > &x2) |
| Return the result of dividing the first argument by the second. More... | |
| template<typename T , typename U , require_arithmetic_t< U > * = nullptr> | |
| fvar< T > | operator/ (const fvar< T > &x1, U x2) |
| Return the result of dividing the first argument by the second. More... | |
| template<typename T , typename U , require_arithmetic_t< U > * = nullptr> | |
| fvar< T > | operator/ (U x1, const fvar< T > &x2) |
| Return the result of dividing the first argument by the second. More... | |
| template<typename T > | |
| std::complex< fvar< T > > | operator/ (const std::complex< fvar< T >> &x1, const std::complex< fvar< T >> &x2) |
| template<typename T , typename U , require_arithmetic_t< U > * = nullptr> | |
| std::complex< fvar< T > > | operator/ (const std::complex< fvar< T >> &x1, const std::complex< U > &x2) |
| template<typename T > | |
| std::complex< fvar< T > > | operator/ (const std::complex< fvar< T >> &x1, const fvar< T > &x2) |
| template<typename T , typename U , require_arithmetic_t< U > * = nullptr> | |
| std::complex< fvar< T > > | operator/ (const std::complex< fvar< T >> &x1, U x2) |
| template<typename T , typename U , require_arithmetic_t< U > * = nullptr> | |
| std::complex< fvar< T > > | operator/ (const std::complex< U > &x1, const std::complex< fvar< T >> &x2) |
| template<typename T , typename U , require_arithmetic_t< U > * = nullptr> | |
| std::complex< fvar< T > > | operator/ (const std::complex< U > &x1, const fvar< T > &x2) |
| template<typename T > | |
| std::complex< fvar< T > > | operator/ (const fvar< T > &x1, const std::complex< fvar< T >> &x2) |
| template<typename T , typename U , typename = std::enable_if_t<std::is_arithmetic<U>::value>> | |
| std::complex< fvar< T > > | operator/ (const fvar< T > &x1, const std::complex< U > &x2) |
| template<typename T , typename U , require_arithmetic_t< U > * = nullptr> | |
| std::complex< fvar< T > > | operator/ (U x1, const std::complex< fvar< T >> &x2) |
| template<typename T > | |
| bool | operator== (const fvar< T > &x, const fvar< T > &y) |
Return true if the specified variables have equal values as defined by ==. More... | |
| template<typename T > | |
| bool | operator== (const fvar< T > &x, double y) |
Return true if the the first variable has a value equal to the second argument as defined by by ==. More... | |
| template<typename T > | |
| bool | operator== (double x, const fvar< T > &y) |
Return true if the the first argument is equal to the value of the second argument as defined by by ==. More... | |
| template<typename T > | |
| bool | operator> (const fvar< T > &x, const fvar< T > &y) |
Return true if the first argument has a greater value than the second as defined by >. More... | |
| template<typename T > | |
| bool | operator> (const fvar< T > &x, double y) |
Return true if the first argument has a greater value than the second as defined by >. More... | |
| template<typename T > | |
| bool | operator> (double x, const fvar< T > &y) |
Return true if the first argument has a greater value than the second as defined by >. More... | |
| template<typename T > | |
| bool | operator>= (const fvar< T > &x, const fvar< T > &y) |
Return true if the value of the first argument is greater than or equal to that of the second as defined by >=. More... | |
| template<typename T > | |
| bool | operator>= (const fvar< T > &x, double y) |
Return true if the value of the first argument has a value greater than or equal to the second argument as defined by >=. More... | |
| template<typename T > | |
| bool | operator>= (double x, const fvar< T > &y) |
Return true if the first argument is greater than or equal to the value of the second argument as defined by >=. More... | |
| template<typename T > | |
| bool | operator< (const fvar< T > &x, const fvar< T > &y) |
Return true if the first argument has a value less than the value of the second argument as defined by <. More... | |
| template<typename T > | |
| bool | operator< (double x, const fvar< T > &y) |
Return true if the first argument is less than the value of the second argument as defined by <. More... | |
| template<typename T > | |
| bool | operator< (const fvar< T > &x, double y) |
Return true if the first argument has a value less than the second argument as defined by <. More... | |
| template<typename T > | |
| bool | operator<= (const fvar< T > &x, const fvar< T > &y) |
Return true if the first argument has a value less than or equal to the value of the second argument as defined by <=. More... | |
| template<typename T > | |
| bool | operator<= (const fvar< T > &x, double y) |
Return true if the first argument has a value less than or equal to the second argument as defined by <=. More... | |
| template<typename T > | |
| bool | operator<= (double x, const fvar< T > &y) |
Return true if the first argument is less than or equal to the second argument's value as defined by <=. More... | |
| template<typename T > | |
| bool | operator&& (const fvar< T > &x, const fvar< T > &y) |
Return the logical conjunction of the values of the two arguments as defined by &&. More... | |
| template<typename T > | |
| bool | operator&& (const fvar< T > &x, double y) |
Return the logical conjunction of the values of the two arguments as defined by &&. More... | |
| template<typename T > | |
| bool | operator&& (double x, const fvar< T > &y) |
Return the logical conjunction of the values of the two arguments as defined by &&. More... | |
| template<typename T > | |
| bool | operator|| (const fvar< T > &x, const fvar< T > &y) |
Return the logical disjunction of the values of the two arguments as defined by ||. More... | |
| template<typename T > | |
| bool | operator|| (const fvar< T > &x, double y) |
Return the logical disjunction of the values of the two arguments as defined by ||. More... | |
| template<typename T > | |
| bool | operator|| (double x, const fvar< T > &y) |
Return the logical disjunction of the values of the two arguments as defined by ||. More... | |
| template<typename T > | |
| fvar< T > | operator* (const fvar< T > &x, const fvar< T > &y) |
| Return the product of the two arguments. More... | |
| template<typename T > | |
| fvar< T > | operator* (double x, const fvar< T > &y) |
| Return the product of the two arguments. More... | |
| template<typename T > | |
| fvar< T > | operator* (const fvar< T > &x, double y) |
| Return the product of the two arguments. More... | |
| template<typename T > | |
| bool | operator!= (const fvar< T > &x, const fvar< T > &y) |
Return true if the value of the two arguments are not equal as defined by !=. More... | |
| template<typename T > | |
| bool | operator!= (const fvar< T > &x, double y) |
Return true if the value of the first argument is not equal to the second argument as defined by !=. More... | |
| template<typename T > | |
| bool | operator!= (double x, const fvar< T > &y) |
Return true if the first argument is not equal to the value of the second argument as defined by !=. More... | |
| template<typename T > | |
| fvar< T > | operator- (const fvar< T > &x1, const fvar< T > &x2) |
| Return the difference of the specified arguments. More... | |
| template<typename T > | |
| fvar< T > | operator- (double x1, const fvar< T > &x2) |
| Return the difference of the specified arguments. More... | |
| template<typename T > | |
| fvar< T > | operator- (const fvar< T > &x1, double x2) |
| Return the difference of the specified arguments. More... | |
| template<typename T > | |
| fvar< T > | operator- (const fvar< T > &x) |
| Return the negation of the specified argument. More... | |
| template<typename T > | |
| bool | operator! (const fvar< T > &x) |
Return the negation of the value of the argument as defined by !. More... | |
| template<typename T > | |
| fvar< T > | operator+ (const fvar< T > &x) |
| Returns the argument. More... | |
| template<typename T > | |
| fvar< T > | abs (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | abs (const std::complex< fvar< T >> &z) |
| Return the absolute value of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | acos (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | acos (const std::complex< fvar< T >> &x) |
| Return the arc cosine of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | acosh (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | acosh (const std::complex< fvar< T >> &z) |
| Return the hyperbolic arc cosine of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | arg (const std::complex< fvar< T >> &z) |
| Return the phase angle of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | asin (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | asin (const std::complex< fvar< T >> &z) |
| Return the arc sine of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | asinh (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | asinh (const std::complex< fvar< T >> &z) |
| Return the hyperbolic arcsine of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | atan (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | atan (const std::complex< fvar< T >> &z) |
| Return the arc tangent of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | atan2 (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | atan2 (double x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | atan2 (const fvar< T > &x1, double x2) |
| template<typename T > | |
| fvar< T > | atanh (const fvar< T > &x) |
| Return inverse hyperbolic tangent of specified value. More... | |
| template<typename T > | |
| std::complex< fvar< T > > | atanh (const std::complex< fvar< T >> &z) |
| Return the hyperbolic arc tangent of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | bessel_first_kind (int v, const fvar< T > &z) |
| template<typename T > | |
| fvar< T > | bessel_second_kind (int v, const fvar< T > &z) |
| template<typename T > | |
| fvar< T > | beta (const fvar< T > &x1, const fvar< T > &x2) |
| Return fvar with the beta function applied to the specified arguments and its gradient. More... | |
| template<typename T > | |
| fvar< T > | beta (double x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | beta (const fvar< T > &x1, double x2) |
| template<typename T > | |
| fvar< T > | binary_log_loss (int y, const fvar< T > &y_hat) |
| template<typename T > | |
| fvar< T > | cbrt (const fvar< T > &x) |
| Return cube root of specified argument. More... | |
| template<typename T > | |
| fvar< T > | ceil (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | conj (const std::complex< fvar< T >> &z) |
| Return the phase angle of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | cos (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | cos (const std::complex< fvar< T >> &z) |
| Return the cosine of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | cosh (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | cosh (const std::complex< fvar< T >> &z) |
| Return the hyperbolic cosine of the complex argument. More... | |
| template<typename EigMat , require_eigen_vt< is_fvar, EigMat > * = nullptr> | |
| value_type_t< EigMat > | determinant (const EigMat &m) |
| template<typename T > | |
| fvar< T > | digamma (const fvar< T > &x) |
| Return the derivative of the log gamma function at the specified argument. More... | |
| template<typename T > | |
| fvar< T > | erf (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | erfc (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | exp (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | exp (const std::complex< fvar< T >> &z) |
| Return the natural exponentiation (base e) of the specified complex number. More... | |
| template<typename T > | |
| fvar< T > | exp2 (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | expm1 (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | fabs (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | falling_factorial (const fvar< T > &x, int n) |
| Return autodiff variable with the gradient and result of the falling factorial function applied to the inputs. More... | |
| template<typename T > | |
| fvar< T > | fdim (const fvar< T > &x, const fvar< T > &y) |
| Return the positive difference of the specified values (C++11). More... | |
| template<typename T > | |
| fvar< T > | fdim (const fvar< T > &x, double y) |
| Return the positive difference of the specified values (C++11). More... | |
| template<typename T > | |
| fvar< T > | fdim (double x, const fvar< T > &y) |
| Return the positive difference of the specified values (C++11). More... | |
| template<typename T > | |
| fvar< T > | floor (const fvar< T > &x) |
| template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr> | |
| fvar< return_type_t< T1, T2, T3 > > | fma (const fvar< T1 > &x1, const fvar< T2 > &x2, const fvar< T3 > &x3) |
| The fused multiply-add operation (C99). More... | |
| template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr> | |
| fvar< return_type_t< T1, T2, T3 > > | fma (const T1 &x1, const fvar< T2 > &x2, const fvar< T3 > &x3) |
| See all-var input signature for details on the function and derivatives. More... | |
| template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr> | |
| fvar< return_type_t< T1, T2, T3 > > | fma (const fvar< T1 > &x1, const T2 &x2, const fvar< T3 > &x3) |
| See all-var input signature for details on the function and derivatives. More... | |
| template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr> | |
| fvar< return_type_t< T1, T2, T3 > > | fma (const fvar< T1 > &x1, const fvar< T2 > &x2, const T3 &x3) |
| See all-var input signature for details on the function and derivatives. More... | |
| template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr> | |
| fvar< return_type_t< T1, T2, T3 > > | fma (const T1 &x1, const T2 &x2, const fvar< T3 > &x3) |
| See all-var input signature for details on the function and derivatives. More... | |
| template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr> | |
| fvar< return_type_t< T1, T2, T3 > > | fma (const fvar< T1 > &x1, const T2 &x2, const T3 &x3) |
| See all-var input signature for details on the function and derivatives. More... | |
| template<typename T1 , typename T2 , typename T3 , require_all_stan_scalar_t< T1, T2, T3 > * = nullptr> | |
| fvar< return_type_t< T1, T2, T3 > > | fma (const T1 &x1, const fvar< T2 > &x2, const T3 &x3) |
| See all-var input signature for details on the function and derivatives. More... | |
| template<typename T > | |
| fvar< T > | fmax (const fvar< T > &x1, const fvar< T > &x2) |
| Return the greater of the two specified arguments. More... | |
| template<typename T > | |
| fvar< T > | fmax (double x1, const fvar< T > &x2) |
| Return the greater of the two specified arguments. More... | |
| template<typename T > | |
| fvar< T > | fmax (const fvar< T > &x1, double x2) |
| Return the greater of the two specified arguments. More... | |
| template<typename T > | |
| fvar< T > | fmin (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | fmin (double x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | fmin (const fvar< T > &x1, double x2) |
| template<typename T > | |
| fvar< T > | fmod (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | fmod (const fvar< T > &x1, double x2) |
| template<typename T > | |
| fvar< T > | fmod (double x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | gamma_p (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | gamma_p (const fvar< T > &x1, double x2) |
| template<typename T > | |
| fvar< T > | gamma_p (double x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | gamma_q (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | gamma_q (const fvar< T > &x1, double x2) |
| template<typename T > | |
| fvar< T > | gamma_q (double x1, const fvar< T > &x2) |
| template<typename T > | |
| void | grad_inc_beta (fvar< T > &g1, fvar< T > &g2, fvar< T > a, fvar< T > b, fvar< T > z) |
| Gradient of the incomplete beta function beta(a, b, z) with respect to the first two arguments. More... | |
| template<typename T > | |
| fvar< T > | hypot (const fvar< T > &x1, const fvar< T > &x2) |
| Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11). More... | |
| template<typename T > | |
| fvar< T > | hypot (const fvar< T > &x1, double x2) |
| Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11). More... | |
| template<typename T > | |
| fvar< T > | hypot (double x1, const fvar< T > &x2) |
| Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11). More... | |
| template<typename T > | |
| fvar< T > | inc_beta (const fvar< T > &a, const fvar< T > &b, const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | inc_beta (double a, const fvar< T > &b, const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | inc_beta (const fvar< T > &a, double b, const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | inc_beta (const fvar< T > &a, const fvar< T > &b, double x) |
| template<typename T > | |
| fvar< T > | inc_beta (double a, double b, const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | inc_beta (const fvar< T > &a, double b, double x) |
| template<typename T > | |
| fvar< T > | inc_beta (double a, const fvar< T > &b, double x) |
| template<typename T > | |
| fvar< T > | inv (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | inv_cloglog (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | inv_logit (const fvar< T > &x) |
| Returns the inverse logit function applied to the argument. More... | |
| template<typename T > | |
| fvar< T > | inv_Phi (const fvar< T > &p) |
| template<typename T > | |
| fvar< T > | inv_sqrt (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | inv_square (const fvar< T > &x) |
| template<typename EigMat , require_eigen_vt< is_fvar, EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::ColsAtCompileTime > | inverse (const EigMat &m) |
| Forward mode specialization of calculating the inverse of the matrix. More... | |
| template<typename T > | |
| int | is_inf (const fvar< T > &x) |
| Returns 1 if the input's value is infinite and 0 otherwise. More... | |
| template<typename T , require_fvar_t< T > * = nullptr> | |
| bool | is_nan (T &&x) |
| Returns 1 if the input's value is NaN and 0 otherwise. More... | |
| template<typename T > | |
| fvar< T > | lambert_w0 (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | lambert_wm1 (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | lbeta (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | lbeta (double x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | lbeta (const fvar< T > &x1, double x2) |
| template<typename T > | |
| fvar< T > | ldexp (const fvar< T > &a, int b) |
| Returns the product of a (the significand) times 2 to power b (the exponent). More... | |
| template<typename T > | |
| fvar< T > | lgamma (const fvar< T > &x) |
| Return the natural logarithm of the gamma function applied to the specified argument. More... | |
| template<typename T > | |
| fvar< return_type_t< T, int > > | lmgamma (int x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | lmultiply (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | lmultiply (double x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | lmultiply (const fvar< T > &x1, double x2) |
| template<typename T > | |
| fvar< T > | log (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | log (const std::complex< fvar< T >> &z) |
| Return the natural logarithm (base e) of the specified complex argument. More... | |
| template<typename T > | |
| fvar< T > | log10 (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | log10 (const std::complex< fvar< T >> &z) |
| Return the base 10 logarithm of the specified complex number. More... | |
| template<typename T > | |
| fvar< T > | log1m (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | log1m_exp (const fvar< T > &x) |
| Return the natural logarithm of one minus the exponentiation of the specified argument. More... | |
| template<typename T > | |
| fvar< T > | log1m_inv_logit (const fvar< T > &x) |
| Return the natural logarithm of one minus the inverse logit of the specified argument. More... | |
| template<typename T > | |
| fvar< T > | log1p (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | log1p_exp (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | log2 (const fvar< T > &x) |
| Return the base two logarithm of the specified argument. More... | |
| template<typename EigMat , require_eigen_vt< is_fvar, EigMat > * = nullptr> | |
| value_type_t< EigMat > | log_determinant (const EigMat &m) |
| Returns the log absolute determinant of the specified square matrix. More... | |
| template<typename T > | |
| fvar< T > | log_diff_exp (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T1 , typename T2 , require_arithmetic_t< T1 > * = nullptr> | |
| fvar< T2 > | log_diff_exp (const T1 &x1, const fvar< T2 > &x2) |
| template<typename T1 , typename T2 , require_arithmetic_t< T2 > * = nullptr> | |
| fvar< T1 > | log_diff_exp (const fvar< T1 > &x1, const T2 &x2) |
| template<typename T > | |
| fvar< T > | log_falling_factorial (const fvar< T > &x, const fvar< T > &n) |
| template<typename T > | |
| fvar< T > | log_falling_factorial (double x, const fvar< T > &n) |
| template<typename T > | |
| fvar< T > | log_falling_factorial (const fvar< T > &x, double n) |
| template<typename T > | |
| fvar< T > | log_inv_logit (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | log_inv_logit_diff (const fvar< T > &x, const fvar< T > &y) |
| Returns fvar with the natural logarithm of the difference of the inverse logits of the specified arguments and its gradients. More... | |
| template<typename T > | |
| fvar< T > | log_inv_logit_diff (const fvar< T > &x, double y) |
| template<typename T > | |
| fvar< T > | log_inv_logit_diff (double x, const fvar< T > &y) |
| template<typename T_theta , typename T_lambda1 , typename T_lambda2 , int N> | |
| void | log_mix_partial_helper (const T_theta &theta, const T_lambda1 &lambda1, const T_lambda2 &lambda2, promote_args_t< T_theta, T_lambda1, T_lambda2 >(&partials_array)[N]) |
| template<typename T > | |
| fvar< T > | log_mix (const fvar< T > &theta, const fvar< T > &lambda1, const fvar< T > &lambda2) |
| Return the log mixture density with specified mixing proportion and log densities and its derivative at each. More... | |
| template<typename T , typename P , require_all_arithmetic_t< P > * = nullptr> | |
| fvar< T > | log_mix (const fvar< T > &theta, const fvar< T > &lambda1, P lambda2) |
| template<typename T , typename P , require_all_arithmetic_t< P > * = nullptr> | |
| fvar< T > | log_mix (const fvar< T > &theta, P lambda1, const fvar< T > &lambda2) |
| template<typename T , typename P , require_all_arithmetic_t< P > * = nullptr> | |
| fvar< T > | log_mix (P theta, const fvar< T > &lambda1, const fvar< T > &lambda2) |
| template<typename T , typename P1 , typename P2 , require_all_arithmetic_t< P1, P2 > * = nullptr> | |
| fvar< T > | log_mix (const fvar< T > &theta, P1 lambda1, P2 lambda2) |
| template<typename T , typename P1 , typename P2 , require_all_arithmetic_t< P1, P2 > * = nullptr> | |
| fvar< T > | log_mix (P1 theta, const fvar< T > &lambda1, P2 lambda2) |
| template<typename T , typename P1 , typename P2 , require_all_arithmetic_t< P1, P2 > * = nullptr> | |
| fvar< T > | log_mix (P1 theta, P2 lambda1, const fvar< T > &lambda2) |
| template<typename T > | |
| fvar< T > | log_rising_factorial (const fvar< T > &x, const fvar< T > &n) |
| template<typename T > | |
| fvar< T > | log_rising_factorial (const fvar< T > &x, double n) |
| template<typename T > | |
| fvar< T > | log_rising_factorial (double x, const fvar< T > &n) |
| template<typename T , require_vector_st< is_fvar, T > * = nullptr> | |
| auto | log_softmax (const T &x) |
| Return the log softmax of the specified vector or container of vectors. More... | |
| template<typename T > | |
| fvar< T > | log_sum_exp (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | log_sum_exp (double x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | log_sum_exp (const fvar< T > &x1, double x2) |
| template<typename T , require_container_st< is_fvar, T > * = nullptr> | |
| auto | log_sum_exp (const T &x) |
| Return the log of the sum of the exponentiated values of the specified matrix of values. More... | |
| template<typename T > | |
| fvar< T > | logit (const fvar< T > &x) |
| template<typename T1 , typename T2 , require_all_eigen_vt< is_fvar, T1, T2 > * = nullptr, require_vt_same< T1, T2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< T1 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > | mdivide_left (const T1 &A, const T2 &b) |
| template<typename T1 , typename T2 , require_eigen_vt< std::is_arithmetic, T1 > * = nullptr, require_eigen_vt< is_fvar, T2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< T2 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > | mdivide_left (const T1 &A, const T2 &b) |
| template<typename T , typename EigMat , require_eigen_vt< std::is_arithmetic, T > * = nullptr, require_eigen_vt< is_fvar, EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, EigMat::ColsAtCompileTime > | mdivide_left_ldlt (LDLT_factor< T > &A, const EigMat &b) |
| Returns the solution of the system Ax=b given an LDLT_factor of A. More... | |
| template<typename T1 , typename T2 , require_all_eigen_vt< is_fvar, T1, T2 > * = nullptr, require_vt_same< T1, T2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< T1 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > | mdivide_left_tri_low (const T1 &A, const T2 &b) |
| template<typename T1 , typename T2 , require_eigen_t< T1 > * = nullptr, require_vt_same< double, T1 > * = nullptr, require_eigen_vt< is_fvar, T2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< T2 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > | mdivide_left_tri_low (const T1 &A, const T2 &b) |
| template<typename T1 , typename T2 , require_eigen_vt< is_fvar, T1 > * = nullptr, require_eigen_t< T2 > * = nullptr, require_vt_same< double, T2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< T1 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > | mdivide_left_tri_low (const T1 &A, const T2 &b) |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_vt< is_fvar, EigMat1, EigMat2 > * = nullptr, require_vt_same< EigMat1, EigMat2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat1 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_right (const EigMat1 &A, const EigMat2 &b) |
| template<typename EigMat1 , typename EigMat2 , require_eigen_vt< std::is_arithmetic, EigMat1 > * = nullptr, require_eigen_vt< is_fvar, EigMat2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat2 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_right (const EigMat1 &A, const EigMat2 &b) |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_vt< is_fvar, EigMat1, EigMat2 > * = nullptr, require_vt_same< EigMat1, EigMat2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat1 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_right_tri_low (const EigMat1 &A, const EigMat2 &b) |
| template<typename EigMat1 , typename EigMat2 , require_eigen_vt< std::is_arithmetic, EigMat1 > * = nullptr, require_eigen_vt< is_fvar, EigMat2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat2 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_right_tri_low (const EigMat1 &A, const EigMat2 &b) |
| template<typename T > | |
| fvar< T > | modified_bessel_first_kind (int v, const fvar< T > &z) |
| template<typename T > | |
| fvar< T > | modified_bessel_second_kind (int v, const fvar< T > &z) |
| template<typename Mat1 , typename Mat2 , require_all_eigen_vt< is_fvar, Mat1, Mat2 > * = nullptr, require_vt_same< Mat1, Mat2 > * = nullptr, require_not_eigen_row_and_col_t< Mat1, Mat2 > * = nullptr> | |
| auto | multiply (const Mat1 &m1, const Mat2 &m2) |
| Return the product of the specified matrices. More... | |
| template<typename T > | |
| fvar< T > | multiply_log (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | multiply_log (double x1, const fvar< T > &x2) |
| template<typename T > | |
| fvar< T > | multiply_log (const fvar< T > &x1, double x2) |
| template<typename EigMat , require_eigen_vt< is_fvar, EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::RowsAtCompileTime > | multiply_lower_tri_self_transpose (const EigMat &m) |
| template<typename T > | |
| fvar< T > | norm (const std::complex< fvar< T >> &z) |
| Return the squared magnitude of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | owens_t (const fvar< T > &x1, const fvar< T > &x2) |
| Return Owen's T function applied to the specified arguments. More... | |
| template<typename T > | |
| fvar< T > | owens_t (double x1, const fvar< T > &x2) |
| Return Owen's T function applied to the specified arguments. More... | |
| template<typename T > | |
| fvar< T > | owens_t (const fvar< T > &x1, double x2) |
| Return Owen's T function applied to the specified arguments. More... | |
| template<typename T > | |
| fvar< T > | Phi (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | Phi_approx (const fvar< T > &x) |
| Return an approximation of the unit normal cumulative distribution function (CDF). More... | |
| template<typename T > | |
| std::complex< fvar< T > > | polar (const fvar< T > &r, const fvar< T > &theta) |
| Returns complex number with specified magnitude and phase angle. More... | |
| template<typename T , typename U > | |
| std::complex< fvar< T > > | polar (const fvar< T > &r, U theta) |
| Returns complex number with specified magnitude and phase angle. More... | |
| template<typename T , typename U > | |
| std::complex< fvar< T > > | polar (U r, const fvar< T > &theta) |
| Returns complex number with specified magnitude and phase angle. More... | |
| template<typename T > | |
| fvar< T > | pow (const fvar< T > &x1, const fvar< T > &x2) |
| template<typename T , typename U , typename = require_arithmetic_t<U>> | |
| fvar< T > | pow (U x1, const fvar< T > &x2) |
| template<typename T , typename U , typename = require_arithmetic_t<U>> | |
| fvar< T > | pow (const fvar< T > &x1, U x2) |
| template<typename V > | |
| std::complex< fvar< V > > | pow (const std::complex< fvar< V >> &x, const std::complex< fvar< V >> &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename V , typename T , typename = require_arithmetic_t<T>> | |
| std::complex< fvar< V > > | pow (const std::complex< fvar< V >> &x, const std::complex< T > &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename V > | |
| std::complex< fvar< V > > | pow (const std::complex< fvar< V >> &x, const fvar< V > &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename V , typename T , typename = require_arithmetic_t<T>> | |
| std::complex< fvar< V > > | pow (const std::complex< fvar< V >> &x, const T &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename V , typename T , typename = require_arithmetic_t<T>> | |
| std::complex< fvar< V > > | pow (const std::complex< T > &x, const std::complex< fvar< V >> &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename V , typename T , typename = require_arithmetic_t<T>> | |
| std::complex< fvar< V > > | pow (const std::complex< T > &x, const fvar< V > &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename V > | |
| std::complex< fvar< V > > | pow (const fvar< V > &x, const std::complex< fvar< V >> &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename V , typename T , typename = require_arithmetic_t<T>> | |
| std::complex< fvar< V > > | pow (const fvar< V > &x, const std::complex< T > &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename T , typename V , typename = require_arithmetic_t<T>> | |
| std::complex< fvar< V > > | pow (T x, const std::complex< fvar< V >> &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename T > | |
| std::complex< fvar< T > > | pow (const std::complex< fvar< T >> &x, int y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename T > | |
| double | primitive_value (const fvar< T > &v) |
| Return the primitive value of the specified forward-mode autodiff variable. More... | |
| template<typename T > | |
| std::complex< fvar< T > > | proj (const std::complex< fvar< T >> &z) |
| Return the projection of the complex argument onto the Riemann sphere. More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_not_eigen_col_vector_t< EigMat2 > * = nullptr, require_any_vt_fvar< EigMat1, EigMat2 > * = nullptr> | |
| promote_scalar_t< return_type_t< EigMat1, EigMat2 >, EigMat2 > | quad_form (const EigMat1 &A, const EigMat2 &B) |
| Return the quadratic form \( B^T A B \). More... | |
| template<typename EigMat , typename ColVec , require_eigen_t< EigMat > * = nullptr, require_eigen_col_vector_t< ColVec > * = nullptr, require_any_vt_fvar< EigMat, ColVec > * = nullptr> | |
| return_type_t< EigMat, ColVec > | quad_form (const EigMat &A, const ColVec &B) |
| Return the quadratic form \( B^T A B \). More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_not_eigen_col_vector_t< EigMat2 > * = nullptr, require_any_vt_fvar< EigMat1, EigMat2 > * = nullptr> | |
| promote_scalar_t< return_type_t< EigMat1, EigMat2 >, EigMat2 > | quad_form_sym (const EigMat1 &A, const EigMat2 &B) |
| Return the quadratic form \( B^T A B \) of a symmetric matrix. More... | |
| template<typename EigMat , typename ColVec , require_eigen_t< EigMat > * = nullptr, require_eigen_col_vector_t< ColVec > * = nullptr, require_any_vt_fvar< EigMat, ColVec > * = nullptr> | |
| return_type_t< EigMat, ColVec > | quad_form_sym (const EigMat &A, const ColVec &B) |
| Return the quadratic form \( B^T A B \) of a symmetric matrix. More... | |
| template<typename EigFvar , typename EigOut > | |
| void | read_fvar (const EigFvar &FvarMat, EigOut &ValMat, EigOut &DMat) |
| Function applying the read_fvar_functor to extract the values and tangets of a given fvar matrix into separate matrices. More... | |
| template<typename T > | |
| fvar< T > | rising_factorial (const fvar< T > &x, int n) |
| Return autodiff variable with the gradient and result of the rising factorial function applied to the inputs. More... | |
| template<typename T > | |
| fvar< T > | round (const fvar< T > &x) |
| Return the closest integer to the specified argument, with halfway cases rounded away from zero. More... | |
| template<typename T > | |
| fvar< T > | sin (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | sin (const std::complex< fvar< T >> &z) |
| Return the sine of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | sinh (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | sinh (const std::complex< fvar< T >> &z) |
| Return the hyperbolic sine of the complex argument. More... | |
| template<typename ColVec , require_eigen_col_vector_vt< is_fvar, ColVec > * = nullptr> | |
| auto | softmax (const ColVec &alpha) |
| template<typename T > | |
| fvar< T > | sqrt (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | sqrt (const std::complex< fvar< T >> &z) |
| Return the square root of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | square (const fvar< T > &x) |
| template<typename T > | |
| fvar< T > | sum (const std::vector< fvar< T >> &m) |
| Return the sum of the entries of the specified standard vector. More... | |
| template<typename T , require_eigen_vt< is_fvar, T > * = nullptr> | |
| value_type_t< T > | sum (const T &m) |
| Return the sum of the entries of the specified matrix. More... | |
| template<typename T > | |
| fvar< T > | tan (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | tan (const std::complex< fvar< T >> &z) |
| Return the tangent of the complex argument. More... | |
| template<typename T > | |
| fvar< T > | tanh (const fvar< T > &x) |
| template<typename T > | |
| std::complex< fvar< T > > | tanh (const std::complex< fvar< T >> &z) |
| Return the hyperbolic tangent of the complex argument. More... | |
| template<typename EigMat , require_eigen_vt< is_fvar, EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::RowsAtCompileTime > | tcrossprod (const EigMat &m) |
| template<typename T > | |
| fvar< T > | tgamma (const fvar< T > &x) |
| Return the result of applying the gamma function to the specified argument. More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr, require_not_fvar_t< T > * = nullptr> | |
| fvar< T > | to_fvar (const T &x) |
| template<typename T , require_fvar_t< scalar_type_t< T >> * = nullptr> | |
| T && | to_fvar (T &&x) |
| Specialization of to_fvar for [containers of] fvars. More... | |
| template<typename T > | |
| std::vector< fvar< T > > | to_fvar (const std::vector< T > &v) |
| template<typename T > | |
| std::vector< fvar< T > > | to_fvar (const std::vector< T > &v, const std::vector< T > &d) |
| template<typename T , require_eigen_t< T > * = nullptr, require_not_eigen_vt< is_fvar, T > * = nullptr> | |
| promote_scalar_t< fvar< value_type_t< T > >, T > | to_fvar (const T &m) |
| template<typename T1 , typename T2 , require_all_eigen_t< T1, T2 > * = nullptr, require_vt_same< T1, T2 > * = nullptr> | |
| promote_scalar_t< fvar< value_type_t< T1 > >, T1 > | to_fvar (const T1 &val, const T2 &deriv) |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_any_vt_fvar< EigMat1, EigMat2 > * = nullptr> | |
| return_type_t< EigMat1, EigMat2 > | trace_quad_form (const EigMat1 &A, const EigMat2 &B) |
| template<typename T > | |
| fvar< T > | trigamma (const fvar< T > &u) |
| Return the value of the trigamma function at the specified argument (i.e., the second derivative of the log Gamma function at the specified argument). More... | |
| template<typename T > | |
| fvar< T > | trunc (const fvar< T > &x) |
| Return the nearest integral value that is not larger in magnitude than the specified argument. More... | |
| template<typename EigMat , require_eigen_col_vector_vt< is_fvar, EigMat > * = nullptr> | |
| auto | unit_vector_constrain (const EigMat &y) |
| template<typename EigMat , typename T , require_eigen_vt< is_fvar, EigMat > * = nullptr, require_stan_scalar_t< T > * = nullptr> | |
| auto | unit_vector_constrain (const EigMat &y, T &lp) |
| template<typename T > | |
| T | value_of (const fvar< T > &v) |
| Return the value of the specified variable. More... | |
| template<typename T > | |
| double | value_of_rec (const fvar< T > &v) |
| Return the value of the specified variable. More... | |
| template<typename T , typename F > | |
| void | gradient (const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, T &fx, Eigen::Matrix< T, Eigen::Dynamic, 1 > &grad_fx) |
| Calculate the value and the gradient of the specified function at the specified argument. More... | |
| template<typename T , typename F > | |
| void | hessian (const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, T &fx, Eigen::Matrix< T, Eigen::Dynamic, 1 > &grad, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &H) |
| Calculate the value, the gradient, and the Hessian, of the specified function at the specified argument in time O(N^3) time and O(N^2) space. More... | |
| template<typename T , typename F > | |
| void | jacobian (const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, Eigen::Matrix< T, Eigen::Dynamic, 1 > &fx, Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &J) |
| template<typename T > | |
| bool | is_aligned (T *ptr, unsigned int bytes_aligned) |
Return true if the specified pointer is aligned on the number of bytes. More... | |
| template<typename T , typename F > | |
| void | derivative (const F &f, const T &x, T &fx, T &dfx_dx) |
| Return the derivative of the specified univariate function at the specified argument. More... | |
| template<typename F > | |
| void | finite_diff_grad_hessian (const F &f, const Eigen::VectorXd &x, double &fx, Eigen::MatrixXd &hess, std::vector< Eigen::MatrixXd > &grad_hess_fx, double epsilon=1e-04) |
| Calculate the value and the gradient of the hessian of the specified function at the specified argument using second-order autodiff and first-order finite difference. More... | |
| template<typename F > | |
| void | finite_diff_grad_hessian_auto (const F &f, const Eigen::VectorXd &x, double &fx, Eigen::MatrixXd &hess, std::vector< Eigen::MatrixXd > &grad_hess_fx) |
| Calculate the value, Hessian, and the gradient of the Hessian of the specified function at the specified argument using second-order autodiff and first-order finite difference. More... | |
| template<typename F > | |
| void | grad_hessian (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, double &fx, Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &H, std::vector< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > > &grad_H) |
| Calculate the value, the Hessian, and the gradient of the Hessian of the specified function at the specified argument. More... | |
| template<typename F > | |
| void | grad_tr_mat_times_hessian (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &M, Eigen::Matrix< double, Eigen::Dynamic, 1 > &grad_tr_MH) |
| template<typename T1 , typename T2 , typename F > | |
| void | gradient_dot_vector (const F &f, const Eigen::Matrix< T1, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< T2, Eigen::Dynamic, 1 > &v, T1 &fx, T1 &grad_fx_dot_v) |
| template<typename F > | |
| void | hessian (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, double &fx, Eigen::Matrix< double, Eigen::Dynamic, 1 > &grad, Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &H) |
| Calculate the value, the gradient, and the Hessian, of the specified function at the specified argument in O(N^2) time and O(N^2) space. More... | |
| template<typename F > | |
| void | hessian_times_vector (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &v, double &fx, Eigen::Matrix< double, Eigen::Dynamic, 1 > &Hv) |
| template<typename T , typename F > | |
| void | hessian_times_vector (const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v, T &fx, Eigen::Matrix< T, Eigen::Dynamic, 1 > &Hv) |
| template<typename T , typename F > | |
| void | partial_derivative (const F &f, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, int n, T &fx, T &dfx_dxn) |
| Return the partial derivative of the specified multivariate function at the specified argument. More... | |
| template<typename T , require_st_arithmetic< T > * = nullptr> | |
| matrix_cl< scalar_type_t< T > > | to_matrix_cl (T &&src) |
Copies the source Eigen matrix, std::vector or scalar to the destination matrix that is stored on the OpenCL device. More... | |
| template<typename T_ret , typename T , require_eigen_t< T_ret > * = nullptr, require_matrix_cl_t< T > * = nullptr, require_st_same< T_ret, T > * = nullptr> | |
| auto | from_matrix_cl (const T &src) |
| Copies the source matrix that is stored on the OpenCL device to the destination Eigen matrix. More... | |
| template<typename T_ret , typename T , require_all_kernel_expressions_t< T > * = nullptr, require_not_matrix_cl_t< T > * = nullptr> | |
| auto | from_matrix_cl (const T &src) |
| Copies result of a kernel generator expression to the specified destination type. More... | |
| template<typename T_dst , typename T , require_arithmetic_t< T > * = nullptr, require_same_t< T_dst, T > * = nullptr> | |
| T_dst | from_matrix_cl (const matrix_cl< T > &src) |
| Copy A 1 by 1 source matrix from the Device to the host. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| auto | from_matrix_cl (const T &src) |
| Copies the source kernel generator expression or matrix that is stored on the OpenCL device to the destination Eigen matrix. More... | |
| template<typename T , require_matrix_cl_t< T > * = nullptr> | |
| auto | packed_copy (const T &src) |
| Packs the square flat triangular matrix on the OpenCL device and copies it to the std::vector. More... | |
| template<matrix_cl_view matrix_view, typename Vec , typename Vec_scalar = scalar_type_t<Vec>, require_vector_vt< std::is_arithmetic, Vec > * = nullptr> | |
| matrix_cl< Vec_scalar > | packed_copy (Vec &&src, int rows) |
| Copies the packed triangular matrix from the source std::vector to an OpenCL buffer and unpacks it to a flat matrix on the OpenCL device. More... | |
| template<typename T , require_matrix_cl_t< T > * = nullptr> | |
| plain_type_t< T > | copy_cl (const T &src) |
| Copies the source matrix to the destination matrix. More... | |
| template<typename T > | |
| void | check_mat_not_size_one (const char *function, const char *name, const matrix_cl< T > &A) |
Check if the matrix_cl has a single element. More... | |
| void | check_opencl_error (const char *function, const cl::Error &e) |
| Throws the domain error with specifying the OpenCL error that occurred. More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| void | check_symmetric (const char *function, const char *name, const matrix_cl< T > &y) |
Check if the matrix_cl is symmetric. More... | |
| template<typename T , require_matrix_cl_t< T > * = nullptr> | |
| void | check_triangular (const char *function, const char *name, const T &A) |
Check if the matrix_cl is either upper triangular or lower triangular. More... | |
| void | indexing_rev (matrix_cl< double > &adj, const matrix_cl< int > &idx, const matrix_cl< double > &res) |
| Performs reverse pass for indexing operation on the OpenCL device. More... | |
| template<typename Ta , typename Tb , typename = require_all_kernel_expressions_and_none_scalar_t<Ta, Tb>> | |
| auto | append_row (Ta &&a, Tb &&b) |
| Stack the rows of the first argument on top of the second argument. More... | |
| template<typename Ta , typename Tb , typename = require_all_kernel_expressions_and_none_scalar_t<Ta, Tb>> | |
| auto | append_col (Ta &&a, Tb &&b) |
| Stack the cols of the arguments. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| auto | as_column_vector_or_scalar (T &&a) |
| as_column_vector_or_scalar of a kernel generator expression. More... | |
| template<typename T_operation , typename = std::enable_if_t<std::is_base_of< operation_cl_base, std::remove_reference_t<T_operation>>::value>> | |
| T_operation && | as_operation_cl (T_operation &&a) |
| Converts any valid kernel generator expression into an operation. More... | |
| template<typename T_scalar , typename = require_arithmetic_t<T_scalar>, require_not_same_t< T_scalar, bool > * = nullptr> | |
| scalar_< T_scalar > | as_operation_cl (const T_scalar a) |
| Converts any valid kernel generator expression into an operation. More... | |
| scalar_< char > | as_operation_cl (const bool a) |
| Converts any valid kernel generator expression into an operation. More... | |
| template<typename T_matrix_cl , typename = require_any_t<is_matrix_cl<T_matrix_cl>, is_arena_matrix_cl<T_matrix_cl>>> | |
| load_< T_matrix_cl > | as_operation_cl (T_matrix_cl &&a) |
| Converts any valid kernel generator expression into an operation. More... | |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| addition_operator_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator+ (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| addition_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | add (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| subtraction_operator_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator- (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| subtraction_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | subtract (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | elt_multiply (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| elt_divide_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | elt_divide (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| elt_modulo_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator% (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| less_than_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator< (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| less_than_or_equal_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator<= (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| greater_than_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator> (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| greater_than_or_equal_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator>= (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| equals_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator== (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| not_equals_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator!= (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| logical_or_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator|| (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_any_not_arithmetic_t< T_a, T_b > * = nullptr> | |
| logical_and_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator&& (T_a &&a, T_b &&b) |
| template<typename T_a , typename T_b , typename = require_arithmetic_t<T_a>, typename = require_all_kernel_expressions_t<T_b>> | |
| elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator* (T_a a, T_b &&b) |
| Multiplication of a scalar and a kernel generator expression. More... | |
| template<typename T_a , typename T_b , typename = require_all_kernel_expressions_t<T_a>, typename = require_arithmetic_t<T_b>> | |
| elt_multiply_< as_operation_cl_t< T_a >, as_operation_cl_t< T_b > > | operator* (T_a &&a, const T_b b) |
| Multiplication of a kernel generator expression and a scalar. More... | |
| template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | block_zero_based (T &&a, int start_row, int start_col, int rows, int cols) |
| Block of a kernel generator expression. More... | |
| template<bool Colwise, bool Rowwise, typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | broadcast (T &&a) |
| Broadcast an expression in specified dimension(s). More... | |
| template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | rowwise_broadcast (T &&a) |
| Broadcast an expression in rowwise dimmension. More... | |
| template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | colwise_broadcast (T &&a) |
| Broadcast an expression in colwise dimmension. More... | |
| template<bool Do_Calculate, typename T , require_all_kernel_expressions_t< T > * = nullptr, std::enable_if_t< Do_Calculate > * = nullptr> | |
| calc_if_< true, as_operation_cl_t< T > > | calc_if (T &&a) |
| template<bool Do_Calculate, typename T , std::enable_if_t<!Do_Calculate > * = nullptr> | |
| calc_if_< false, scalar_< double > > | calc_if (T &&a) |
| template<typename Scalar , typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| auto | cast (T &&a) |
| Typecast a kernel generator expression scalar. More... | |
| template<typename Scalar , typename T , require_stan_scalar_t< T > * = nullptr> | |
| Scalar | cast (T a) |
| Typecast a scalar. More... | |
| template<typename T , typename = require_all_kernel_expressions_t<T>> | |
| auto | check_cl (const char *function, const char *var_name, T &&y, const char *must_be) |
| Constructs a check on opencl matrix or expression. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| auto | colwise_sum (T &&a) |
| Column wise sum - reduction of a kernel generator expression. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| auto | colwise_prod (T &&a) |
| Column wise product - reduction of a kernel generator expression. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| auto | colwise_max (T &&a) |
| Column wise max - reduction of a kernel generator expression. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| auto | colwise_min (T &&a) |
| Column wise min - reduction of a kernel generator expression. More... | |
| template<typename T1 , typename T2 , require_kernel_expression_lhs_t< T1 > * = nullptr, require_all_kernel_expressions_t< T2 > * = nullptr> | |
| T1 | operator+= (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_kernel_expression_lhs_t< T1 > * = nullptr, require_all_kernel_expressions_t< T2 > * = nullptr> | |
| T1 | operator-= (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_kernel_expression_lhs_t< T1 > * = nullptr, require_all_kernel_expressions_t< T2 > * = nullptr> | |
| T1 | operator*= (T1 &&a, T2 &&b) |
| template<typename T , typename = require_arithmetic_t<T>> | |
| auto | constant (const T a, int rows, int cols) |
| Matrix of repeated values in kernel generator expressions. More... | |
| template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | diagonal (T &&a) |
| Diagonal of a kernel generator expression. More... | |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| rsqrt_< as_operation_cl_t< T > > | rsqrt (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| sqrt_< as_operation_cl_t< T > > | sqrt (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| cbrt_< as_operation_cl_t< T > > | cbrt (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| exp_< as_operation_cl_t< T > > | exp (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| exp2_< as_operation_cl_t< T > > | exp2 (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| expm1_< as_operation_cl_t< T > > | expm1 (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| log_< as_operation_cl_t< T > > | log (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| log2_< as_operation_cl_t< T > > | log2 (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| log10_< as_operation_cl_t< T > > | log10 (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| log1p_< as_operation_cl_t< T > > | log1p (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| sin_< as_operation_cl_t< T > > | sin (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| sinh_< as_operation_cl_t< T > > | sinh (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| cos_< as_operation_cl_t< T > > | cos (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| cosh_< as_operation_cl_t< T > > | cosh (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| tan_< as_operation_cl_t< T > > | tan (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| tanh_< as_operation_cl_t< T > > | tanh (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| asin_< as_operation_cl_t< T > > | asin (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| asinh_< as_operation_cl_t< T > > | asinh (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| acos_< as_operation_cl_t< T > > | acos (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| acosh_< as_operation_cl_t< T > > | acosh (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| atan_< as_operation_cl_t< T > > | atan (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| atanh_< as_operation_cl_t< T > > | atanh (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| tgamma_< as_operation_cl_t< T > > | tgamma (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| lgamma_< as_operation_cl_t< T > > | lgamma (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| erf_< as_operation_cl_t< T > > | erf (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| erfc_< as_operation_cl_t< T > > | erfc (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| floor_< as_operation_cl_t< T > > | floor (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| round_< as_operation_cl_t< T > > | round (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| ceil_< as_operation_cl_t< T > > | ceil (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| fabs_< as_operation_cl_t< T > > | fabs (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| trunc_< as_operation_cl_t< T > > | trunc (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| digamma_< as_operation_cl_t< T > > | digamma (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| log1m_< as_operation_cl_t< T > > | log1m (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| log_inv_logit_< as_operation_cl_t< T > > | log_inv_logit (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| log1m_exp_< as_operation_cl_t< T > > | log1m_exp (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| log1p_exp_< as_operation_cl_t< T > > | log1p_exp (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| inv_square_< as_operation_cl_t< T > > | inv_square (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| inv_logit_< as_operation_cl_t< T > > | inv_logit (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| logit_< as_operation_cl_t< T > > | logit (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| Phi_< as_operation_cl_t< T > > | Phi (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| Phi_approx_< as_operation_cl_t< T > > | Phi_approx (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| inv_Phi_< as_operation_cl_t< T > > | inv_Phi (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| log1m_inv_logit_< as_operation_cl_t< T > > | log1m_inv_logit (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| trigamma_< as_operation_cl_t< T > > | trigamma (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| square_< as_operation_cl_t< T > > | square (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| isfinite_< as_operation_cl_t< T > > | isfinite (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| isinf_< as_operation_cl_t< T > > | isinf (T &&a) |
| template<typename T , typename Cond = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| isnan_< as_operation_cl_t< T > > | isnan (T &&a) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| fdim_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | fdim (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| fmax_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | fmax (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| fmin_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | fmin (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| fmod_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | fmod (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| hypot_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | hypot (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| ldexp_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | ldexp (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| pow_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | pow (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| copysign_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | copysign (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| beta_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | beta (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| binomial_coefficient_log_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | binomial_coefficient_log (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| lbeta_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | lbeta (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| log_inv_logit_diff_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | log_inv_logit_diff (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| log_diff_exp_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | log_diff_exp (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| multiply_log_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | multiply_log (T1 &&a, T2 &&b) |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr, require_any_not_stan_scalar_t< T1, T2 > * = nullptr> | |
| lmultiply_< as_operation_cl_t< T1 >, as_operation_cl_t< T2 > > | lmultiply (T1 &&a, T2 &&b) |
| template<typename T , typename... Ptrs, require_all_kernel_expressions_t< T, Ptrs... > * = nullptr> | |
| auto | holder_cl (T &&a, Ptrs *...ptrs) |
| Constructs a no-op operation that also holds pointer to some other expressions, allocated on heap. More... | |
| template<typename T , typename... Args, require_all_kernel_expressions_t< decltype(std::declval< T >()(std::declval< Args & >()...)), Args... > * = nullptr> | |
| auto | make_holder_cl (const T &func, Args &&...args) |
| Constructs an expression from given arguments using given functor. More... | |
| template<typename T_mat , typename T_row_index , typename T_col_index , require_all_kernel_expressions_t< T_mat, T_row_index, T_col_index > * = nullptr> | |
| auto | indexing (T_mat &&mat, T_row_index &&row_index, T_col_index &&col_index) |
| Index a kernel generator expression using two expressions for indices. More... | |
| template<typename T_matrix , typename T_vector , typename = require_all_kernel_expressions_t<T_matrix, T_vector>> | |
| auto | matrix_vector_multiply (T_matrix &&matrix, T_vector &&vector) |
| Multiplies a matrix and a vector on an OpenCL device. More... | |
| template<typename... T_expressions> | |
| expressions_cl< T_expressions... > | expressions (T_expressions &&...expressions) |
Deduces types for constructing expressions_cl object. More... | |
| template<typename... T_results> | |
| results_cl< T_results... > | results (T_results &&...results) |
Deduces types for constructing results_cl object. More... | |
| template<const char * Code, typename... T_arguments, require_all_kernel_expressions_t< T_arguments... > * = nullptr> | |
| auto | opencl_code (std::tuple< typename std::pair< const char *, T_arguments >::first_type... > names, T_arguments &&...arguments) |
| Custom code in kernel generator expressions. More... | |
| template<bool Colwise, bool Rowwise, typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| optional_broadcast_< as_operation_cl_t< T >, Colwise, Rowwise > | optional_broadcast (T &&a) |
| Broadcast an expression in specified dimension(s) if the size along that dimension equals 1. More... | |
| template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | rowwise_optional_broadcast (T &&a) |
| Broadcast an expression in rowwise dimmension if the number of columns equals to 1. More... | |
| template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | colwise_optional_broadcast (T &&a) |
| Broadcast an expression in colwise dimmension if the number of rows equals to 1. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| auto | sum_2d (T &&a) |
| Two dimensional sum - reduction of a kernel generator expression. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| auto | prod_2d (T &&a) |
| Two dimensional product - reduction of a kernel generator expression. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| auto | max_2d (T &&a) |
| Two dimensional max - reduction of a kernel generator expression. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| auto | min_2d (T &&a) |
| Two dimensional min - reduction of a kernel generator expression. More... | |
| template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | rowwise_sum (T &&a) |
| Rowwise sum reduction of a kernel generator expression. More... | |
| template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | rowwise_prod (T &&a) |
| Rowwise product reduction of a kernel generator expression. More... | |
| template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | rowwise_max (T &&a) |
| Rowwise max reduction of a kernel generator expression. More... | |
| template<typename T , typename = require_all_kernel_expressions_and_none_scalar_t<T>> | |
| auto | rowwise_min (T &&a) |
| Min reduction of a kernel generator expression. More... | |
| template<typename T_condition , typename T_then , typename T_else , require_all_kernel_expressions_t< T_condition, T_then, T_else > * = nullptr, require_any_not_arithmetic_t< T_condition, T_then, T_else > * = nullptr> | |
| select_< as_operation_cl_t< T_condition >, as_operation_cl_t< T_then >, as_operation_cl_t< T_else > > | select (T_condition &&condition, T_then &&then, T_else &&els) |
| Selection operation on kernel generator expressions. More... | |
| template<typename T_then , typename T_else , require_all_arithmetic_t< T_then, T_else > * = nullptr> | |
| std::common_type_t< T_then, T_else > | select (bool condition, T_then then, T_else els) |
| Scalar overload of the selection operation. More... | |
| template<typename Arg , typename = require_all_kernel_expressions_and_none_scalar_t<Arg>> | |
| auto | transpose (Arg &&a) |
| Transposes a kernel generator expression. More... | |
| template<typename T > | |
| std::string | type_str () |
| Determines a string name of a type. More... | |
| template<> | |
| std::string | type_str< double > () |
| template<> | |
| std::string | type_str< int > () |
| template<> | |
| std::string | type_str< char > () |
| template<> | |
| std::string | type_str< bool > () |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| logical_negation_< as_operation_cl_t< T > > | operator! (T &&a) |
| Logical negation of a kernel generator expression. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| unary_minus_< as_operation_cl_t< T > > | operator- (T &&a) |
| Unary minus of a kernel generator expression. More... | |
| const matrix_cl_view | either (const matrix_cl_view left_view, const matrix_cl_view right_view) |
| Determines which parts are nonzero in any of the input views. More... | |
| const matrix_cl_view | both (const matrix_cl_view left_view, const matrix_cl_view right_view) |
| Determines which parts are nonzero in both input views. More... | |
| bool | contains_nonzero (const matrix_cl_view view, const matrix_cl_view part) |
| Check whether a view contains certain nonzero part. More... | |
| const matrix_cl_view | transpose (const matrix_cl_view view) |
| Transposes a view - swaps lower and upper parts. More... | |
| const matrix_cl_view | invert (const matrix_cl_view view) |
| Inverts a view. More... | |
| matrix_cl_view | from_eigen_uplo_type (Eigen::UpLoType eigen_type) |
Creates a view from Eigen::UpLoType. More... | |
| int | either (int left_view, int right_view) |
| Determines which parts are nonzero in any of the input views. More... | |
| int | both (int left_view, int right_view) |
| Determines which parts are nonzero in both input views. More... | |
| bool | contains_nonzero (int view, int part) |
| Check whether a view contains certain nonzero part. More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| matrix_cl< T > | multiply_transpose (const matrix_cl< T > &A) |
| Computes the product of a square OpenCL matrix with its transpose. More... | |
| template<typename T_m , typename T_a , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr, require_all_kernel_expressions_t< T_a > * = nullptr> | |
| auto | add_diag (T_m &&mat, T_a &&to_add) |
| Returns a Matrix with values added along the main diagonal. More... | |
| template<typename T_x , typename T_y , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_x, T_y > * = nullptr> | |
| auto | append_array (T_x &&x, T_y &&y) |
| Return the concatenation of two specified vectors in the order of the arguments. More... | |
| template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr> | |
| return_type_t< T_prob_cl > | bernoulli_cdf (const T_n_cl &n, const T_prob_cl &theta) |
| Returns the CDF of the Bernoulli distribution. More... | |
| template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr> | |
| return_type_t< T_prob_cl > | bernoulli_lccdf (const T_n_cl &n, const T_prob_cl &theta) |
| Returns the log CCDF of the Bernoulli distribution. More... | |
| template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr> | |
| return_type_t< T_prob_cl > | bernoulli_lcdf (const T_n_cl &n, const T_prob_cl &theta) |
| Returns the log CDF of the Bernoulli distribution. More... | |
| template<bool propto, typename T_x_cl , typename T_y_cl , typename T_alpha_cl , typename T_beta_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_x_cl, T_alpha_cl, T_beta_cl > * = nullptr> | |
| return_type_t< T_x_cl, T_alpha_cl, T_beta_cl > | bernoulli_logit_glm_lpmf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta) |
| Returns the log PMF of the Generalized Linear Model (GLM) with Bernoulli distribution and logit link function. More... | |
| template<bool propto, typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr> | |
| return_type_t< T_prob_cl > | bernoulli_logit_lpmf (const T_n_cl &n, const T_prob_cl &theta) |
| Returns the log PMF of the logit-parametrized Bernoulli distribution. More... | |
| template<bool propto, typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr> | |
| return_type_t< T_prob_cl > | bernoulli_lpmf (const T_n_cl &n, const T_prob_cl &theta) |
| Returns the log PMF of the Bernoulli distribution. More... | |
| template<bool propto, typename T_n_cl , typename T_N_cl , typename T_size1_cl , typename T_size2_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_size1_cl, T_size2_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_size1_cl, T_size2_cl > * = nullptr> | |
| return_type_t< T_n_cl, T_size1_cl, T_size2_cl > | beta_binomial_lpmf (const T_n_cl &n, const T_N_cl N, const T_size1_cl &alpha, const T_size2_cl &beta) |
| Returns the log PMF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters. More... | |
| template<bool propto, typename T_y_cl , typename T_scale_succ_cl , typename T_scale_fail_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_succ_cl, T_scale_fail_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_succ_cl, T_scale_fail_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_scale_succ_cl, T_scale_fail_cl > | beta_lpdf (const T_y_cl &y, const T_scale_succ_cl &alpha, const T_scale_fail_cl &beta) |
| The log of the beta density for the specified scalar(s) given the specified sample stan::math::size(s). More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_prec_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_prec_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_prec_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_prec_cl > | beta_proportion_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_prec_cl &kappa) |
| The log of the beta density for specified y, location, and precision: beta_proportion_lpdf(y | mu, kappa) = beta_lpdf(y | mu * kappa, (1 - mu) * kappa). More... | |
| template<bool propto, typename T_n_cl , typename T_N_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr, require_any_nonscalar_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr> | |
| return_type_t< T_prob_cl > | binomial_logit_lpmf (const T_n_cl &n, const T_N_cl N, const T_prob_cl &alpha) |
| Binomial log PMF in logit parametrization. More... | |
| template<bool propto, typename T_n_cl , typename T_N_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr, require_any_nonscalar_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr> | |
| return_type_t< T_prob_cl > | binomial_lpmf (const T_n_cl &n, const T_N_cl N, const T_prob_cl &theta) |
| Returns the log PMF for the binomial distribution evaluated at the specified success, population size, and chance of success. More... | |
| template<typename T_x , typename = require_all_kernel_expressions_and_none_scalar_t<T_x>> | |
| auto | block (T_x &&x, size_t i, size_t j, size_t nrows, size_t ncols) |
| Return a nrows x ncols submatrix starting at (i-1, j-1). More... | |
| template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , require_all_prim_or_rev_kernel_expression_t< T_y, T_x, T_alpha, T_beta > * = nullptr> | |
| return_type_t< T_x, T_alpha, T_beta > | categorical_logit_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| Returns the log PMF of the Generalized Linear Model (GLM) with categorical distribution and logit (softmax) link function. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | cauchy_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the cauchy cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | cauchy_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the cauchy log complementary cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | cauchy_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the cauchy cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | cauchy_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s). More... | |
| template<bool propto, typename T_y_cl , typename T_dof_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_dof_cl > | chi_square_lpdf (const T_y_cl &y, const T_dof_cl &nu) |
| The log of a chi-squared density for y with the specified degrees of freedom parameter. More... | |
| matrix_cl< double > | cholesky_decompose (const matrix_cl< double > &A) |
| Returns the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric matrix on the OpenCL device. More... | |
| template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>> | |
| auto | col (T_x &&x, size_t j) |
| Return the specified column of the specified kernel generator expression using start-at-1 indexing. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| int | cols (const T_x &x) |
| Returns the number of columns in the specified kernel generator expression. More... | |
| template<typename T_a , typename T_b , require_all_kernel_expressions_and_none_scalar_t< T_a, T_b > * = nullptr> | |
| auto | columns_dot_product (const T_a &a, const T_b &b) |
| Returns the dot product of columns of the specified matrices. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| auto | columns_dot_self (const T &a) |
| Returns the dot product of each column of a matrix with itself. More... | |
| template<typename T_A , typename = require_all_kernel_expressions_and_none_scalar_t<T_A>> | |
| matrix_cl< typename std::decay_t< T_A >::Scalar > | crossprod (T_A &&A) |
| Returns the result of pre-multiplying a matrix by its own transpose. More... | |
| template<typename T_vec , require_all_kernel_expressions_and_none_scalar_t< T_vec > * = nullptr> | |
| auto | cumulative_sum (T_vec &&v) |
| Return the cumulative sum of the specified vector. More... | |
| template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr> | |
| auto | diag_matrix (T_x &&x) |
| Return a square diagonal matrix with the specified vector of coefficients as the diagonal values. More... | |
| template<typename T1 , typename T2 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr> | |
| auto | diag_post_multiply (const T1 &m1, const T2 &m2) |
| Return the product of a matrix and the diagonal matrix formed from the vector or row_vector. More... | |
| template<typename T1 , typename T2 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr> | |
| auto | diag_pre_multiply (const T1 &m1, const T2 &m2) |
| Return the product of the diagonal matrix formed from the vector or row_vector and a matrix. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| void | dims (const T_x &x, std::vector< int > &result) |
| matrix_cl overload of the dims helper function in prim/fun/dims.hpp. More... | |
| template<bool propto, typename T_prob_cl , typename T_prior_size_cl , require_all_prim_or_rev_kernel_expression_t< T_prob_cl, T_prior_size_cl > * = nullptr, require_any_not_stan_scalar_t< T_prob_cl, T_prior_size_cl > * = nullptr> | |
| return_type_t< T_prob_cl, T_prior_size_cl > | dirichlet_lpdf (const T_prob_cl &theta, const T_prior_size_cl &alpha) |
| The log of the Dirichlet density for the given theta and a vector of prior sample sizes, alpha. More... | |
| template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr> | |
| auto | distance (const T_a &a, const T_b &b) |
| Returns the distance between the specified vectors. More... | |
| template<typename T_a , typename = require_all_kernel_expressions_and_none_scalar_t<T_a>> | |
| auto | divide (T_a &&a, double d) |
| Returns the elementwise division of the kernel generator expression. More... | |
| template<typename T1 , typename T2 , typename = require_all_arithmetic_t<T1, T2>> | |
| void | divide_columns (matrix_cl< T1 > &A, const matrix_cl< T2 > &B) |
| Divides each column of a matrix by a vector. More... | |
| template<typename T1 , typename T2 , typename = require_all_arithmetic_t<T1, T2>> | |
| void | divide_columns (matrix_cl< T1 > &A, const T2 &divisor) |
| Divides each column of a matrix by a scalar. More... | |
| template<typename T_a , typename T_b , require_all_kernel_expressions_and_none_scalar_t< T_a, T_b > * = nullptr> | |
| auto | dot_product (const T_a &a, const T_b &b) |
| Returns the dot product of the specified vectors. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| auto | dot_self (const T &a) |
| Returns squared norm of a vector or matrix. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | double_exponential_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the double exponential cumulative density function. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | double_exponential_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the double exponential log complementary cumulative density function. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | double_exponential_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the double exponential log cumulative density function. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | double_exponential_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the double exponential log probability density function. More... | |
| matrix_cl< double > | eigenvalues_sym (const matrix_cl< double > &m) |
| matrix_cl< double > | eigenvectors_sym (const matrix_cl< double > &m) |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > | exp_mod_normal_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda) |
| Returns the double exponential cumulative density function. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > | exp_mod_normal_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda) |
| Returns the exp mod normal log complementary cumulative density function. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > | exp_mod_normal_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda) |
| Returns the exp mod normal log cumulative density function. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > | exp_mod_normal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda) |
| Returns the log PMF of the exp mod normal distribution. More... | |
| template<typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_inv_scale_cl > | exponential_cdf (const T_y_cl &y, const T_inv_scale_cl &beta) |
| Calculates the exponential cumulative distribution function for the given y and beta. More... | |
| template<typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_inv_scale_cl > | exponential_lccdf (const T_y_cl &y, const T_inv_scale_cl &beta) |
| Calculates the log exponential cumulative distribution function for the given y and beta. More... | |
| template<typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_inv_scale_cl > | exponential_lcdf (const T_y_cl &y, const T_inv_scale_cl &beta) |
| Calculates the log exponential cumulative distribution function for the given y and beta. More... | |
| template<bool propto, typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_inv_scale_cl > | exponential_lpdf (const T_y_cl &y, const T_inv_scale_cl &beta) |
| The log of an exponential density for y with the specified inverse scale parameter. More... | |
| template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_shape_cl, T_scale_cl > | frechet_cdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma) |
| Returns the frechet cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_shape_cl, T_scale_cl > | frechet_lccdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma) |
| Returns the frechet log complementary cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_shape_cl, T_scale_cl > | frechet_lcdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma) |
| Returns the frechet log cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_shape_cl, T_scale_cl > | frechet_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma) |
| The log of the frechet density for the specified scalar(s) given the specified sample stan::math::size(s). More... | |
| template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_inv_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_shape_cl, T_inv_scale_cl > | gamma_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_inv_scale_cl &beta) |
| The log of a gamma density for y with the specified shape and inverse scale parameters. More... | |
| template<typename T_x , typename T_sigma , require_all_prim_or_rev_kernel_expression_t< T_x > * = nullptr, require_stan_scalar_t< T_sigma > * = nullptr> | |
| auto | gp_dot_prod_cov (const T_x &x, const T_sigma sigma) |
| Dot product kernel on the GPU. More... | |
| template<typename T_x , typename T_y , typename T_sigma , require_all_prim_or_rev_kernel_expression_t< T_x, T_y > * = nullptr, require_stan_scalar_t< T_sigma > * = nullptr> | |
| auto | gp_dot_prod_cov (const T_x &x, const T_y &y, const T_sigma sigma) |
| Dot product kernel on the GPU. More... | |
| template<typename T1 , typename T2 , typename T3 , typename = require_all_arithmetic_t<T1, T2, T3>> | |
| matrix_cl< return_type_t< T1, T2, T3 > > | gp_exp_quad_cov (const matrix_cl< T1 > &x, const T2 sigma, const T3 length_scale) |
| Squared exponential kernel on the GPU. More... | |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename = require_all_arithmetic_t<T1, T2, T3, T4>> | |
| matrix_cl< return_type_t< T1, T2, T3, T4 > > | gp_exp_quad_cov (const matrix_cl< T1 > &x, const matrix_cl< T2 > &y, const T3 sigma, const T4 length_scale) |
| Squared exponential kernel on the GPU. More... | |
| template<typename T1 , typename T2 , typename T3 , require_all_kernel_expressions_and_none_scalar_t< T1 > * = nullptr, require_all_arithmetic_t< T2, T3 > * = nullptr> | |
| matrix_cl< return_type_t< T1, T2, T3 > > | gp_exponential_cov (const T1 &x, const T2 sigma, const T3 length_scale) |
| Matern exponential kernel on the GPU. More... | |
| template<typename T1 , typename T2 , typename T3 , typename T4 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr, require_all_arithmetic_t< T3, T4 > * = nullptr> | |
| matrix_cl< return_type_t< T1, T2, T3, T4 > > | gp_exponential_cov (const T1 &x, const T2 &y, const T3 sigma, const T4 length_scale) |
| Matern exponential kernel on the GPU. More... | |
| template<typename T1 , typename T2 , typename T3 , require_all_kernel_expressions_and_none_scalar_t< T1 > * = nullptr, require_all_arithmetic_t< T2, T3 > * = nullptr> | |
| matrix_cl< return_type_t< T1, T2, T3 > > | gp_matern32_cov (const T1 &x, const T2 sigma, const T3 length_scale) |
| Matern 3/2 kernel on the GPU. More... | |
| template<typename T1 , typename T2 , typename T3 , typename T4 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr, require_all_arithmetic_t< T3, T4 > * = nullptr> | |
| matrix_cl< return_type_t< T1, T2, T3, T4 > > | gp_matern32_cov (const T1 &x, const T2 &y, const T3 sigma, const T4 length_scale) |
| Matern 3/2 kernel on the GPU. More... | |
| template<typename T1 , typename T2 , typename T3 , require_all_kernel_expressions_and_none_scalar_t< T1 > * = nullptr, require_all_arithmetic_t< T2, T3 > * = nullptr> | |
| matrix_cl< return_type_t< T1, T2, T3 > > | gp_matern52_cov (const T1 &x, const T2 sigma, const T3 length_scale) |
| Matern 5/2 kernel on the GPU. More... | |
| template<typename T1 , typename T2 , typename T3 , typename T4 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr, require_all_arithmetic_t< T3, T4 > * = nullptr> | |
| matrix_cl< return_type_t< T1, T2, T3, T4 > > | gp_matern52_cov (const T1 &x, const T2 &y, const T3 sigma, const T4 length_scale) |
| Matern 5/2 kernel on the GPU. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | gumbel_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta) |
| Returns the gumbel cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | gumbel_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta) |
| Returns the Gumbel log complementary cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | gumbel_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta) |
| Returns the Gumbel log complementary cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | gumbel_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta) |
| Returns the Gumbel log probability density for the given location and scale. More... | |
| template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>> | |
| auto | head (T_x &&x, size_t n) |
| Return the specified number of elements as a vector or row vector (same as input) from the front of the specified vector or row vector. More... | |
| template<typename T_x , require_matrix_cl_t< T_x > * = nullptr> | |
| auto | identity_matrix (int K) |
| Return a square identity matrix. More... | |
| template<typename T_x , typename = require_all_kernel_expressions_and_none_scalar_t<T_x>> | |
| auto | inv (T_x &&x) |
| Return the elementwise 1.0 / x of the specified argument, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<bool propto, typename T_y_cl , typename T_dof_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_dof_cl > | inv_chi_square_lpdf (const T_y_cl &y, const T_dof_cl &nu) |
| The log of an inverse chi-squared density for y with the specified degrees of freedom parameter. More... | |
| template<typename T_x , typename = require_all_kernel_expressions_and_none_scalar_t<T_x>> | |
| auto | inv_cloglog (T_x &&x) |
| The inverse complementary log-log function. More... | |
| template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_shape_cl, T_scale_cl > | inv_gamma_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &beta) |
| The log of an inverse gamma density for y with the specified shape and scale parameters. More... | |
| template<typename T_x , typename = require_all_kernel_expressions_and_none_scalar_t<T_x>> | |
| auto | inv_sqrt (T_x &&x) |
Return the elementwise 1 / sqrt(x) of the specified kernel generator expression. More... | |
| template<typename T , typename L , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< L > * = nullptr> | |
| auto | lb_constrain (T &&x, L &&lb) |
| Return the lower-bounded value for the specified unconstrained input and specified lower bound. More... | |
| template<typename T , typename L , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< L > * = nullptr> | |
| auto | lb_constrain (const T &x, const L &lb, return_type_t< T, L > &lp) |
| Return the lower-bounded value for the specified unconstrained input and specified lower bound. More... | |
| template<typename T_theta_cl , typename T_lambda_cl , require_all_prim_or_rev_kernel_expression_t< T_theta_cl, T_lambda_cl > * = nullptr> | |
| auto | log_mix (const T_theta_cl &theta, const T_lambda_cl &lambda) |
| Return the log mixture density with specified mixing proportions and log densities. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| matrix_cl< double > | log_softmax (const T &a) |
| Return log of the softmax of the specified vector. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| double | log_sum_exp (const T &a) |
| Return the log of the sum of the exponentiated values of the specified matrix of values. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | logistic_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the logistic cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | logistic_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the logistic cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | logistic_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the logistic cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | logistic_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| The log of a logistic density for y with the specified location and scale parameters. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | lognormal_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the loghormal cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | lognormal_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the lognormal log complementary cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | lognormal_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the lognormal log cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | lognormal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| The log of the lognormal density for the specified scalar(s) given the specified sample stan::math::size(s). More... | |
| template<typename T , typename L , typename U , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< L, U > * = nullptr> | |
| matrix_cl< double > | lub_constrain (const T &x, const L &lb, const U &ub) |
| Return the lower and upper-bounded matrix derived by transforming the specified free matrix given the specified lower and upper bounds. More... | |
| template<typename T , typename L , typename U , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< L, U > * = nullptr> | |
| auto | lub_constrain (const T &x, const L &lb, const U &ub, return_type_t< T, L, U > &lp) |
| Return the lower and upper-bounded matrix derived by transforming the specified free matrix given the specified lower and upper bounds. More... | |
| template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr> | |
| plain_type_t< T_m > | matrix_power (T_m &&M, const int n) |
| Returns the nth power of the specific matrix. More... | |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr> | |
| matrix_cl< double > | mdivide_left_tri_low (const T1 &A, const T2 &b) |
| Returns the solution of the system Ax=b when A is lower triangular. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| matrix_cl< double > | mdivide_left_tri_low (const T &A) |
| Returns the solution of the system Ax=b when A is triangular and b=I. More... | |
| template<typename T1 , typename T2 , require_all_kernel_expressions_t< T1, T2 > * = nullptr> | |
| matrix_cl< double > | mdivide_right_tri_low (const T2 &b, const T1 &A) |
| Returns the solution of the system Ax=b where A is a lower triangular matrix. More... | |
| template<typename T , require_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| scalar_type_t< T > | mean (const T &m) |
| Returns the sample mean (i.e., average) of the coefficients in the specified std vector, vector, row vector, or matrix. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_covar_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_covar_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_covar_cl > | multi_normal_cholesky_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_covar_cl &L) |
| The log of the multivariate normal density for the given y, mu, and a Cholesky factor L of the variance matrix. More... | |
| template<typename T1 , typename T2 , typename = require_all_kernel_expressions_and_none_scalar_t<T1, T2>> | |
| matrix_cl< return_type_t< T1, T2 > > | multiply (const T1 &A, const T2 &B) |
| Computes the product of the specified matrices with the option of specifying the triangularity of either input matrices. More... | |
| template<typename T_a , typename T_b , typename = require_all_kernel_expressions_and_none_scalar_t<T_a, T_b>> | |
| matrix_cl< return_type_t< T_a, T_b > > | operator* (const T_a &a, const T_b &b) |
| Matrix multiplication of two kernel generator expressions. More... | |
| template<typename T_a , typename T_b , require_stan_scalar_t< T_a > * = nullptr, require_all_kernel_expressions_and_none_scalar_t< T_b > * = nullptr, require_all_not_var_t< T_a, T_b > * = nullptr> | |
| matrix_cl< return_type_t< T_a, T_b > > | multiply (const T_a &a, const T_b &b) |
| Matrix multiplication of a scalar and a kernel generator expressions. More... | |
| template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr> | |
| auto | multiply_lower_tri_self_transpose (T_x &&x) |
| Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose. More... | |
| template<bool propto, typename T_y_cl , typename T_x_cl , typename T_alpha_cl , typename T_beta_cl , typename T_phi_cl , require_all_prim_or_rev_kernel_expression_t< T_x_cl, T_y_cl, T_alpha_cl, T_beta_cl, T_phi_cl > * = nullptr> | |
| return_type_t< T_x_cl, T_alpha_cl, T_beta_cl, T_phi_cl > | neg_binomial_2_log_glm_lpmf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta, const T_phi_cl &phi) |
| Returns the log PMF of the Generalized Linear Model (GLM) with Negative-Binomial-2 distribution and log link function. More... | |
| template<bool propto, typename T_n_cl , typename T_log_location_cl , typename T_precision_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_log_location_cl, T_precision_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_log_location_cl, T_precision_cl > * = nullptr> | |
| return_type_t< T_n_cl, T_log_location_cl, T_precision_cl > | neg_binomial_2_log_lpmf (const T_n_cl &n, const T_log_location_cl &eta, const T_precision_cl &phi) |
| The log of the log transformed negative binomial density for the specified scalars given the specified mean(s) and deviation(s). More... | |
| template<bool propto, typename T_n_cl , typename T_location_cl , typename T_precision_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_location_cl, T_precision_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_location_cl, T_precision_cl > * = nullptr> | |
| return_type_t< T_n_cl, T_location_cl, T_precision_cl > | neg_binomial_2_lpmf (const T_n_cl &n, const T_location_cl &mu, const T_precision_cl &phi) |
| The log of the negative binomial density for the specified scalars given the specified mean(s) and deviation(s). More... | |
| template<bool propto, typename T_n_cl , typename T_shape_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_shape_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_shape_cl, T_inv_scale_cl > * = nullptr> | |
| return_type_t< T_n_cl, T_shape_cl, T_inv_scale_cl > | neg_binomial_lpmf (const T_n_cl &n, const T_shape_cl &alpha, const T_inv_scale_cl &beta) |
| The log of the negative binomial density for the specified scalars given the specified mean(s) and deviation(s). More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | normal_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the normal cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y_cl , typename T_x_cl , typename T_alpha_cl , typename T_beta_cl , typename T_sigma_cl , require_all_prim_or_rev_kernel_expression_t< T_x_cl, T_y_cl, T_alpha_cl, T_beta_cl, T_sigma_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_x_cl, T_alpha_cl, T_beta_cl, T_sigma_cl > | normal_id_glm_lpdf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta, const T_sigma_cl &sigma) |
| Returns the log PDF of the Generalized Linear Model (GLM) with Normal distribution and id link function. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | normal_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the normal log complementary cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | normal_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| Returns the normal log complementary cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl > | normal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma) |
| The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s). More... | |
| template<typename T , require_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| size_t | num_elements (const T &m) |
Returns the number of the elements of a matrix_cl or var_value<matrix_cl<T>>. More... | |
| template<typename T , typename M , typename S , require_all_kernel_expressions_t< T, M, S > * = nullptr, require_any_not_stan_scalar_t< T, M, S > * = nullptr> | |
| auto | offset_multiplier_constrain (const T &x, const M &mu, const S &sigma) |
| Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier. More... | |
| template<typename T , typename M , typename S , require_all_kernel_expressions_t< T, M, S > * = nullptr, require_any_not_stan_scalar_t< T, M, S > * = nullptr> | |
| auto | offset_multiplier_constrain (const T &x, const M &mu, const S &sigma, double &lp) |
| Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier. More... | |
| template<bool propto, typename T_y , typename T_x , typename T_beta , typename T_cuts , require_all_prim_or_rev_kernel_expression_t< T_y, T_x, T_beta, T_cuts > * = nullptr> | |
| return_type_t< T_x, T_beta, T_cuts > | ordered_logistic_glm_lpmf (const T_y &y, const T_x &x, const T_beta &beta, const T_cuts &cuts) |
| Returns the log PMF of the ordinal regression Generalized Linear Model (GLM). More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_cuts_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_cuts_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_cuts_cl > | ordered_logistic_lpmf (const T_y_cl &y, const T_loc_cl &lambda, const T_cuts_cl &cuts) |
| Returns the (natural) log probability of the specified array of integers given the vector of continuous locations and specified cutpoints in an ordered logistic model. More... | |
| template<typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_scale_cl, T_shape_cl > | pareto_cdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha) |
| Returns the Pareto cumulative density function. More... | |
| template<typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_scale_cl, T_shape_cl > | pareto_lccdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha) |
| Returns the Pareto cumulative density function. More... | |
| template<typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_scale_cl, T_shape_cl > | pareto_lcdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha) |
| Returns the Pareto cumulative density function. More... | |
| template<bool propto, typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_scale_cl, T_shape_cl > | pareto_lpdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha) |
| The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s). More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > | pareto_type_2_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha) |
| Returns the pareto type 2 cumulative density function. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > | pareto_type_2_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha) |
| Returns the pareto type 2 log complementaty cumulative density function. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > | pareto_type_2_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha) |
| Returns the pareto type 2 log cumulative density function. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > | pareto_type_2_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha) |
| Returns the log PMF of the Pareto type 2 distribution. More... | |
| template<bool propto, typename T_y_cl , typename T_x_cl , typename T_alpha_cl , typename T_beta_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_x_cl, T_alpha_cl, T_beta_cl > * = nullptr> | |
| return_type_t< T_x_cl, T_alpha_cl, T_beta_cl > | poisson_log_glm_lpmf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta) |
| Returns the log PMF of the Generalized Linear Model (GLM) with Poisson distribution and log link function. More... | |
| template<bool propto, typename T_n_cl , typename T_log_rate_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_log_rate_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_log_rate_cl > * = nullptr> | |
| return_type_t< T_log_rate_cl > | poisson_log_lpmf (const T_n_cl &n, const T_log_rate_cl &alpha) |
| Returns the log PMF of the Poisson log distribution. More... | |
| template<bool propto, typename T_n_cl , typename T_rate_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_rate_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_rate_cl > * = nullptr> | |
| return_type_t< T_rate_cl > | poisson_lpmf (const T_n_cl &n, const T_rate_cl &lambda) |
| Returns the log PMF of the Poisson distribution. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| value_type_t< T > | prod (const T &m) |
| Calculates product of given kernel generator expression elements. More... | |
| template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr> | |
| matrix_cl< double > | qr_Q (T_m &&m) |
| Returns the orthogonal factor of the fat QR decomposition. More... | |
| template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr> | |
| matrix_cl< double > | qr_R (T_m &&m) |
| Returns the orthogonal factor of the fat QR decomposition. More... | |
| template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr> | |
| matrix_cl< double > | qr_thin_Q (T_m &&m) |
| Returns the orthogonal factor of the fat QR decomposition. More... | |
| template<typename T_m , require_all_kernel_expressions_and_none_scalar_t< T_m > * = nullptr> | |
| matrix_cl< double > | qr_thin_R (T_m &&m) |
| Returns the orthogonal factor of the thin QR decomposition. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| int | rank (const T &v, int s) |
| Return the number of components of v less than v[s]. More... | |
| template<typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_scale_cl > | rayleigh_cdf (const T_y_cl &y, const T_scale_cl &sigma) |
| Returns the Rayleigh cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_scale_cl > | rayleigh_lccdf (const T_y_cl &y, const T_scale_cl &sigma) |
| Returns the Rayleigh log complementary cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_scale_cl > | rayleigh_lcdf (const T_y_cl &y, const T_scale_cl &sigma) |
| Returns the Rayleigh log cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_scale_cl > | rayleigh_lpdf (const T_y_cl &y, const T_scale_cl &sigma) |
| The log of an Rayleigh density for y with the specified scale parameter. More... | |
| template<typename T , require_any_t< is_matrix_cl< T >, math::conjunction< is_var< T >, is_matrix_cl< value_type_t< T >>>> * = nullptr> | |
| auto | rep_array (const scalar_type_t< T > &x, int n) |
| Creates a matrix_cl representing an array by replicating the input value. More... | |
| template<typename T , require_matrix_cl_t< T > * = nullptr> | |
| auto | rep_matrix (const value_type_t< T > &x, int n, int m) |
| Creates a matrix_cl by replicating the given value of arithmetic type. More... | |
| template<typename T , require_arithmetic_t< T > * = nullptr> | |
| auto | rep_matrix (const matrix_cl< T > &x, int m) |
| Creates a matrix_cl by replicating the input vector or row_vector. More... | |
| template<typename T , require_any_t< is_matrix_cl< T >, math::conjunction< is_var< T >, is_matrix_cl< value_type_t< T >>>> * = nullptr> | |
| auto | rep_row_vector (const scalar_type_t< T > &x, int n) |
| Creates a matrix_cl representing a row vector by replicating the input value. More... | |
| template<typename T , require_any_t< is_matrix_cl< T >, math::conjunction< is_var< T >, is_matrix_cl< value_type_t< T >>>> * = nullptr> | |
| auto | rep_vector (const scalar_type_t< T > &x, int n) |
| Creates a matrix_cl representing a vector by replicating the input value. More... | |
| template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr> | |
| auto | reverse (T_x &&x) |
| Return reversed view into the specified vector or row vector. More... | |
| template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>> | |
| auto | row (T_x &&x, size_t j) |
| Return the specified row of the specified kernel generator expression using start-at-1 indexing. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| int | rows (const T_x &x) |
| Returns the number of rows in the specified kernel generator expression. More... | |
| template<typename T_a , typename T_b , require_all_kernel_expressions_and_none_scalar_t< T_a, T_b > * = nullptr> | |
| auto | rows_dot_product (T_a &&a, T_b &&b) |
| Returns the dot product of rows of the specified matrices. More... | |
| template<typename T_a , require_all_kernel_expressions_and_none_scalar_t< T_a > * = nullptr> | |
| auto | rows_dot_self (T_a &&a) |
| Returns the dot product of each row of a matrix with itself. More... | |
| template<bool propto, typename T_y_cl , typename T_dof_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_dof_cl, T_scale_cl > | scaled_inv_chi_square_lpdf (const T_y_cl &y, const T_dof_cl &nu, const T_scale_cl &s) |
| The log of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| double | sd (const T &a) |
| Returns the unbiased sample standard deviation of the coefficients in the specified std vector, column vector, row vector, or matrix. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| auto | segment (T_x &&x, size_t i, size_t n) |
| Return the specified number of elements as a row/column vector starting from the specified element - 1 of the specified row/column vector. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| auto | sign (const T &x) |
| Returns signs of the arguments. More... | |
| template<typename T , require_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| size_t | size (const T &m) |
Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > | skew_double_exponential_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau) |
| Returns the skew double exponential cumulative density function. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > | skew_double_exponential_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau) |
| Returns the skew double exponential cumulative density function. More... | |
| template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > | skew_double_exponential_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau) |
| Returns the skew double exponential cumulative density function. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > | skew_double_exponential_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau) |
| Returns the log PMF of the skew double exponential distribution. More... | |
| template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > | skew_normal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_shape_cl &alpha) |
| The log of the skew normal density for the specified scalar(s) given the specified mean(s), deviation(s) and shape(s). More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| matrix_cl< double > | softmax (const T &a) |
| Return the softmax of the specified vector. More... | |
| template<typename T , require_all_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | sort_asc (T &&input) |
| Sort the (row)vector in ascending order. More... | |
| template<typename T , require_all_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | sort_desc (T &&input) |
| Sort the (row)vector in ascending order. More... | |
| template<typename T_a , typename T_b , require_all_kernel_expressions_and_none_scalar_t< T_a, T_b > * = nullptr> | |
| auto | squared_distance (const T_a &a, const T_b &b) |
| Returns the squared distance. More... | |
| template<typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr> | |
| return_type_t< T_y_cl > | std_normal_cdf (const T_y_cl &y) |
| Returns the standard normal cumulative distribution function. More... | |
| template<typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr> | |
| return_type_t< T_y_cl > | std_normal_lccdf (const T_y_cl &y) |
| Returns the log standard normal complementary cumulative distribution function. More... | |
| template<typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr> | |
| return_type_t< T_y_cl > | std_normal_lcdf (const T_y_cl &y) |
| Returns the log standard normal complementary cumulative distribution function. More... | |
| template<bool propto, typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr> | |
| return_type_t< T_y_cl > | std_normal_lpdf (const T_y_cl &y) |
| The log of the normal density for the specified scalar(s) given a location of 0 and a scale of 1. More... | |
| template<bool propto, typename T_y_cl , typename T_dof_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl, T_loc_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_dof_cl, T_loc_cl, T_scale_cl > | student_t_lpdf (const T_y_cl &y, const T_dof_cl &nu, const T_loc_cl &mu, const T_scale_cl &sigma) |
| The log of the Student-t density for the given y, nu, mean, and scale parameter. More... | |
| template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>> | |
| auto | sub_col (T_x &&x, size_t i, size_t j, size_t nrows) |
| Return a 1 x ncols subrow starting at (i-1, j-1). More... | |
| template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>> | |
| auto | sub_row (T_x &&x, size_t i, size_t j, size_t ncols) |
| Return a 1 x ncols subrow starting at (i-1, j-1). More... | |
| template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr> | |
| auto | symmetrize_from_lower_tri (T_x &&x) |
| Return a symmetric matrix using elements from the upper triangular part of the input matrix. More... | |
| template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr> | |
| auto | symmetrize_from_upper_tri (T_x &&x) |
| Return a symmetric matrix using elements from the lower triangular part of the input matrix. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| auto | tail (T_x &&x, size_t n) |
| Return the specified number of elements as a vector or row vector (same as input) from the back of the specified vector or row vector. More... | |
| template<typename T_A , typename = require_all_kernel_expressions_and_none_scalar_t<T_A>> | |
| matrix_cl< typename std::decay_t< T_A >::Scalar > | tcrossprod (T_A &&A) |
| Returns the result of post-multiplying a matrix by its own transpose. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| auto | to_array_1d (T_x &&x) |
| Returns input matrix reshaped into a vector. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| T_x | to_array_2d (T_x &&x) |
| Returns input matrix converted into a nested std vector. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| T_x | to_matrix (T_x &&x) |
| Returns input matrix. More... | |
| template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr> | |
| matrix_cl< return_type_t< T_x > > | to_matrix (const T_x &x, int m, int n) |
| Returns a matrix representation of a vector or matrix in column-major order with the specified number of rows and columns. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| auto | to_matrix (const T_x &x, int m, int n, bool col_major) -> decltype(to_matrix(x, m, n)) |
| Returns a matrix representation of the vector or matrix in column-major or row major order with the specified number of rows and columns. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| auto | to_row_vector (T_x &&x) |
| Returns input matrix reshaped into a row vector. More... | |
| template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr> | |
| auto | to_vector (T_x &&x) |
| Returns input matrix reshaped into a vector. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| value_type_t< T > | trace (const T &m) |
| Calculates trace (sum of diagonal) of given kernel generator expression. More... | |
| template<typename T , typename U , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< U > * = nullptr> | |
| auto | ub_constrain (T &&x, U &&ub) |
| Return the upper-bounded value for the specified unconstrained matrix and upper bound. More... | |
| template<typename T , typename U , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr, require_all_kernel_expressions_t< U > * = nullptr> | |
| auto | ub_constrain (const T &x, const U &ub, return_type_t< T, U > &lp) |
| Return the upper-bounded value for the specified unconstrained matrix and upper bound. More... | |
| template<typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_low_cl, T_high_cl > | uniform_cdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta) |
| Returns the uniform cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_low_cl, T_high_cl > | uniform_lccdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta) |
| Returns the log uniform complementary cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_low_cl, T_high_cl > | uniform_lcdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta) |
| Returns the log uniform cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_low_cl, T_high_cl > | uniform_lpdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta) |
| The log of a uniform density for the given y, lower, and upper bound. More... | |
| template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr> | |
| auto | unit_vector_constrain (T_x &&x) |
| Return the unit length vector corresponding to the given free vector. More... | |
| template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr> | |
| auto | unit_vector_constrain (T_x &&x, double &lp) |
| Return the unit length vector corresponding to the given free vector. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| double | variance (const T &a) |
| Return the sample variance of the var_value matrix Raise domain error if size is not greater than zero. More... | |
| template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_shape_cl, T_scale_cl > | weibull_cdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma) |
| Returns the weibull cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_shape_cl, T_scale_cl > | weibull_lccdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma) |
| Returns the weibull log cumulative complementary distribution function for the given location, and scale. More... | |
| template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_shape_cl, T_scale_cl > | weibull_lcdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma) |
| Returns the weibull log cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr> | |
| return_type_t< T_y_cl, T_shape_cl, T_scale_cl > | weibull_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma) |
| Returns the Weibull log probability density for the given location and scale. More... | |
| template<bool need_Q = true> | |
| void | qr_decomposition_cl (const matrix_cl< double > &A, matrix_cl< double > &Q, matrix_cl< double > &R, int r=100) |
| Calculates QR decomposition of A using the block Householder algorithm. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | acos (const var_value< T > &A) |
Returns the elementwise acos() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | acosh (const var_value< T > &A) |
Returns the elementwise acosh() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| auto | add (T_a &&a, T_b &&b) |
| Addition of two reverse mode matrices and/or kernel generator expressions. More... | |
| template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr> | |
| auto | operator+ (const T_a &a, const T_b &b) |
| Addition of two reverse mode matrices and/or kernel generator expressions. More... | |
| template<typename T_m , typename T_a , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_m > * = nullptr, require_all_prim_or_rev_kernel_expression_t< T_a > * = nullptr, require_any_var_t< T_m, T_a > * = nullptr> | |
| auto | add_diag (const T_m &mat, const T_a &to_add) |
| Returns a Matrix with values added along the main diagonal. More... | |
| template<typename... T_results> | |
| adjoint_results_cl< T_results... > | adjoint_results (T_results &&...results) |
Deduces types for constructing adjoint_results_cl object. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | append_col (T_a &&a, T_b &&b) |
| Return the result of appending the second argument matrix after the first argument matrix, that is, putting them side by side, with the first matrix followed by the second matrix. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | append_row (T_a &&a, T_b &&b) |
| Return the result of stacking the rows of the first argument matrix on top of the second argument matrix. More... | |
| template<typename T , require_all_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_any_var_t< T > * = nullptr> | |
| auto | as_column_vector_or_scalar (const T &m) |
| Converts kernel generator expression row or column vector to a column vector. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | asin (const var_value< T > &A) |
Returns the elementwise asin() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | asinh (const var_value< T > &A) |
Returns the elementwise asinh() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | atan (const var_value< T > &A) |
Returns the elementwise atan() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | atanh (const var_value< T > &A) |
Returns the elementwise atanh() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| auto | beta (T_a &&a, T_b &&b) |
Return the elementwise beta() on two input kernel generator expression. More... | |
| template<typename T , require_all_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_any_var_t< T > * = nullptr> | |
| auto | block (const T &m, size_t i, size_t j, size_t nrows, size_t ncols) |
| Return a nrows x ncols submatrix starting at (i-1, j-1). More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | cbrt (const var_value< T > &A) |
Returns the elementwise cbrt() of the input var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | ceil (const var_value< T > &A) |
Returns the elementwise ceil() of the specified variable. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | cholesky_decompose (const var_value< T > &A) |
| Returns the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric reverse mode matrix on the OpenCL device. More... | |
| template<typename T1 , typename T2 , require_any_var_t< T1, T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr> | |
| var_value< matrix_cl< double > > | columns_dot_product (T1 &&v1, T2 &&v2) |
| Returns the dot product of columns of the specified matrices. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | columns_dot_self (const var_value< T > &v) |
| Returns the dot product of each column of a matrix with itself. More... | |
| template<typename T > | |
| var_value< matrix_cl< value_type_t< T > > > | to_matrix_cl (const var_value< T > &a) |
| Copies the source var containing Eigen matrices to destination var that has data stored on the OpenCL device. More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< value_type_t< T > > > | to_matrix_cl (const std::vector< var_value< T >> &a) |
| Copies the source std::vector of vars to a destination var that has data stored on the OpenCL device. More... | |
| template<typename T , require_eigen_vt< is_var, T > * = nullptr> | |
| var_value< matrix_cl< value_type_t< value_type_t< T > > > > | to_matrix_cl (const T &src) |
| Copies the source Eigen matrix of vars to the destination matrix that is stored on the OpenCL device. More... | |
| template<typename T , require_eigen_vt< is_var, T > * = nullptr> | |
| var_value< matrix_cl< value_type_t< value_type_t< T > > > > | to_matrix_cl (const std::vector< T > &src) |
| Copies the source vector of Eigen matrices of vars to the destination matrix that is stored on the OpenCL device. More... | |
| template<typename T_dst , typename T , require_var_vt< is_eigen, T_dst > * = nullptr, require_all_kernel_expressions_t< T > * = nullptr> | |
| T_dst | from_matrix_cl (const var_value< T > &a) |
| Copies the source var that has data stored on the OpenCL device to destination var containing Eigen matrix. More... | |
| template<typename T_dst , typename T , require_std_vector_vt< is_var, T_dst > * = nullptr, require_all_stan_scalar_t< value_type_t< T_dst >> * = nullptr, require_all_kernel_expressions_t< T > * = nullptr> | |
| T_dst | from_matrix_cl (const var_value< T > &a) |
Copies the source var that has data stored on the OpenCL device to destination std::vector containing vars. More... | |
| template<typename T , require_all_kernel_expressions_t< T > * = nullptr> | |
| auto | from_matrix_cl (const var_value< T > &src) |
| Copies the source var that has data stored on the OpenCL device to destination Eigen matrix containing vars. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | cos (const var_value< T > &A) |
Returns the elementwise cos() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | cosh (const var_value< T > &A) |
Returns the elementwise cosh() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | crossprod (const var_value< T > &M) |
| Returns the result of pre-multiplying a matrix by its own transpose. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | cumulative_sum (const var_value< T > &A) |
| Return the cumulative sum of the specified vector. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | diag_matrix (const var_value< T > &v) |
| Return a square diagonal matrix with the specified vector of coefficients as the diagonal values. More... | |
| template<typename T1 , typename T2 , require_any_var_t< T1, T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr> | |
| var_value< matrix_cl< double > > | diag_post_multiply (T1 &&v1, T2 &&v2) |
| Return the product of a matrix and the diagonal matrix formed from the vector or row_vector. More... | |
| template<typename T1 , typename T2 , require_any_var_t< T1, T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr> | |
| var_value< matrix_cl< double > > | diag_pre_multiply (T1 &&v1, T2 &&v2) |
| Return the product of the diagonal matrix formed from the vector or row_vector and a matrix. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | diagonal (const var_value< T > &M) |
| Return a column vector of the diagonal elements of the specified matrix. More... | |
| var_value< matrix_cl< double > > | digamma (const var_value< matrix_cl< double >> &A) |
Returns the elementwise digamma() of a var_value<matrix_cl<double>>. More... | |
| template<typename T_a , typename T_b , require_stan_scalar_t< T_b > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | divide (T_a &&a, T_b &&b) |
| Elementwise division of a kernel generator expression and a scalar. More... | |
| template<typename T1 , typename T2 , require_any_var_t< T1, T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr> | |
| var | dot_product (T1 &&v1, T2 &&v2) |
| Returns the dot product. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var | dot_self (const var_value< T > &v) |
| Returns the dot product of a vector of var with itself. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | elt_divide (T_a &&a, T_b &&b) |
| Elementwise division of two reverse mode matrices and/or kernel generator expressions. More... | |
| template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | elt_multiply (T_a &&a, T_b &&b) |
| Elementwise multiplication of two reverse mode matrices and/or kernel generator expressions. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | erf (const var_value< T > &A) |
Returns the elementwise erf() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | erfc (const var_value< T > &A) |
Returns the elementwise erfc() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | exp (const var_value< T > &A) |
Returns the elementwise exp() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | exp2 (const var_value< T > &A) |
Returns the elementwise exp2() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | expm1 (const var_value< T > &A) |
Returns the elementwise expm1() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | fabs (const var_value< T > &A) |
Returns the elementwise fabs() of the input var_value<matrix_cl<double>>. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | fdim (T_a &&a, T_b &&b) |
| Return the positive difference between the first variable's the value and the second's (C99, C++11). More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | floor (const var_value< T > &A) |
Returns the elementwise floor() of the input var_value<matrix_cl<double>>. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | fmax (T_a &&a, T_b &&b) |
| Return the greater of the two specified arguments. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | fmin (T_a &&a, T_b &&b) |
| Return the lesser of the two specified arguments. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | fmod (T_a &&a, T_b &&b) |
| Return the floating point remainder after dividing the first variable by the second (cmath). More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | hypot (T_a &&a, T_b &&b) |
Returns the elementwise hypot() of the input. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | inv (const var_value< T > &A) |
Returns the elementwise inv() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | inv_cloglog (const var_value< T > &A) |
Returns the elementwise inv_cloglog() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | inv_logit (const var_value< T > &A) |
Returns the elementwise inv_logit() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | inv_Phi (const var_value< T > &A) |
Returns the elementwise inv_Phi() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | inv_sqrt (const var_value< T > &A) |
Returns the elementwise inv_sqrt() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | inv_square (const var_value< T > &A) |
Returns the elementwise inv_square() of a var_value<matrix_cl<double>>. More... | |
| template<typename T_x , typename T_lb , require_all_prim_or_rev_kernel_expression_t< T_x, T_lb > * = nullptr, require_any_var_t< T_x, T_lb > * = nullptr, require_any_not_stan_scalar_t< T_x, T_lb > * = nullptr> | |
| var_value< matrix_cl< double > > | lb_constrain (T_x &&x, T_lb &&lb) |
| Return the lower-bounded value for the specified unconstrained input and specified lower bound. More... | |
| template<typename T_x , typename T_lb , require_all_prim_or_rev_kernel_expression_t< T_x, T_lb > * = nullptr, require_any_var_t< T_x, T_lb > * = nullptr, require_any_not_stan_scalar_t< T_x, T_lb > * = nullptr> | |
| var_value< matrix_cl< double > > | lb_constrain (T_x &&x, T_lb &&lb, var &lp) |
| Return the lower-bounded value for the specified unconstrained input and specified lower bound. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| auto | lbeta (T_a &&a, T_b &&b) |
Return the elementwise lbeta() on two input kernel generator expression. More... | |
| template<typename T_a , typename T_b , require_all_kernel_expressions_t< T_a, T_b > * = nullptr, require_st_integral< T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | ldexp (const var_value< T_a > &a, T_b &&b) |
Returns the elementwise ldexp() of the input var_value<matrix_cl<double>> and kernel generator expression. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | lgamma (const var_value< T > &A) |
Returns the elementwise lgamma() of a var_value<matrix_cl<double>>. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | lmultiply (T_a &&a, T_b &&b) |
Returns the elementwise lmultiply() of the input. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | log (const var_value< T > &A) |
Returns the elementwise log() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | log10 (const var_value< T > &A) |
Returns the elementwise log10() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | log1m (const var_value< T > &A) |
Returns the elementwise log1m() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | log1m_exp (const var_value< T > &A) |
Returns the elementwise log1m_exp() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | log1m_inv_logit (const var_value< T > &A) |
Returns the elementwise log1m_inv_logit() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | log1p (const var_value< T > &A) |
Returns the elementwise log1p() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | log1p_exp (const var_value< T > &A) |
Returns the elementwise log1p_exp() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | log2 (const var_value< T > &A) |
Returns the elementwise log2() of a var_value<matrix_cl<double>>. More... | |
| template<typename T_x , typename T_y , require_all_prim_or_rev_kernel_expression_t< T_x, T_y > * = nullptr, require_any_var_t< T_x, T_y > * = nullptr, require_any_not_stan_scalar_t< T_x, T_y > * = nullptr> | |
| var_value< matrix_cl< double > > | log_diff_exp (T_x &&x, T_y &&y) |
| Returns the natural logarithm of the difference of the natural exponentiation of x and the natural exponentiation of y. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | log_inv_logit (const var_value< T > &A) |
Returns the elementwise log_inv_logit() of a var_value<matrix_cl<double>>. More... | |
| template<typename T_x , typename T_y , require_all_prim_or_rev_kernel_expression_t< T_x, T_y > * = nullptr, require_any_var_t< T_x, T_y > * = nullptr, require_any_not_stan_scalar_t< T_x, T_y > * = nullptr> | |
| var_value< matrix_cl< double > > | log_inv_logit_diff (T_x &&x, T_y &&y) |
| Returns the natural logarithm of the difference of the inverse logits of the specified arguments. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | log_softmax (const var_value< T > &A) |
| Return log of the softmax of the specified vector. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var | log_sum_exp (const var_value< T > &A) |
| Return the log of the sum of the exponentiated values of the specified matrix of values. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | logit (const var_value< T > &A) |
Returns the elementwise logit() of a var_value<matrix_cl<double>>. More... | |
| template<typename T_x , typename T_lb , typename T_ub , require_all_prim_or_rev_kernel_expression_t< T_x, T_lb, T_ub > * = nullptr, require_any_var_t< T_x, T_lb, T_ub > * = nullptr, require_any_not_stan_scalar_t< T_x, T_lb, T_ub > * = nullptr> | |
| var_value< matrix_cl< double > > | lub_constrain (T_x &&x, T_lb &&lb, T_ub &&ub) |
| Return the bounded value for the specified unconstrained input and specified bounds. More... | |
| template<typename T_x , typename T_lb , typename T_ub , require_all_prim_or_rev_kernel_expression_t< T_x, T_lb, T_ub > * = nullptr, require_any_var_t< T_x, T_lb, T_ub > * = nullptr, require_any_not_stan_scalar_t< T_x, T_lb, T_ub > * = nullptr> | |
| var_value< matrix_cl< double > > | lub_constrain (T_x &&x, T_lb &&lb, T_ub &&ub, var &lp) |
| Return the bounded value for the specified unconstrained input and specified bounds. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | matrix_power (const var_value< T > &M, const int n) |
| Returns the nth power of the specific matrix. More... | |
| template<typename T1 , typename T2 , require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr, require_any_var_t< T1, T2 > * = nullptr> | |
| var_value< matrix_cl< double > > | mdivide_left_tri_low (T1 &&A, T2 &&b) |
| Returns the solution of the system Ax=b when A is lower triangular. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | mdivide_left_tri_low (const var_value< T > &A) |
| Returns the solution of the system Ax=b when A is triangular and b=I. More... | |
| template<typename T1 , typename T2 , require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr, require_any_var_t< T1, T2 > * = nullptr> | |
| var_value< matrix_cl< double > > | mdivide_right_tri_low (T2 &&b, T1 &&A) |
| Returns the solution of the system Ax=b when A is lower triangular. More... | |
| template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr> | |
| auto | multiply (T_a &&A, T_b &&B) |
| Matrix multiplication of two reverse mode matrices and/or kernel generator expressions. More... | |
| template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr> | |
| auto | operator* (const T_a &A, const T_b &B) |
| Matrix multiplication of two reverse mode matrices and/or kernel generator expressions. More... | |
| template<typename T1 , typename T2 , require_stan_scalar_t< T1 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T2 > * = nullptr, require_any_var_t< T1, T2 > * = nullptr> | |
| auto | multiply (const T1 &A, T2 &&B) |
| Return matrix multiplied by a scalar. More... | |
| template<typename T1 , typename T2 , require_stan_scalar_t< T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1 > * = nullptr, require_any_var_t< T1, T2 > * = nullptr> | |
| auto | multiply (const T1 &A, const T2 &B) |
| Return matrix multiplied by a scalar. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | multiply_log (T_a &&a, T_b &&b) |
Returns the elementwise multiply_log() of the input. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | multiply_lower_tri_self_transpose (const var_value< T > &A) |
| Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose. More... | |
| template<typename T , typename M , typename S , require_all_prim_or_rev_kernel_expression_t< T, M, S > * = nullptr, require_any_not_stan_scalar_t< T, M, S > * = nullptr, require_any_var_t< T, M, S > * = nullptr> | |
| var_value< matrix_cl< double > > | offset_multiplier_constrain (T &&A, M &&mu, S &&sigma) |
| Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier. More... | |
| template<typename T , typename M , typename S , require_all_prim_or_rev_kernel_expression_t< T, M, S > * = nullptr, require_any_not_stan_scalar_t< T, M, S > * = nullptr, require_any_var_t< T, M, S > * = nullptr> | |
| var_value< matrix_cl< double > > | offset_multiplier_constrain (T &&A, M &&mu, S &&sigma, var &lp) |
| Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | operator- (const var_value< T > &M) |
| Returns the unary minus of the input. More... | |
| template<typename T , require_var_vt< is_kernel_expression_and_not_scalar, T > * = nullptr> | |
| T | operator+ (T &&M) |
| Returns the unary plus of the input. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | Phi (const var_value< T > &A) |
Returns the elementwise Phi() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | Phi_approx (const var_value< T > &A) |
Returns the elementwise Phi_approx() of a var_value<matrix_cl<double>>. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| var_value< matrix_cl< double > > | pow (T_a &&a, T_b &&b) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var | prod (const var_value< T > &x) |
| Returns the prod of the coefficients of the specified matrix on the OpenCL device. More... | |
| template<typename T_ret , require_var_vt< is_matrix_cl, T_ret > * = nullptr> | |
| var_value< matrix_cl< double > > | rep_matrix (const var &A, int n, int m) |
| Creates a matrix_cl by replicating the given value of arithmetic type. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | rep_matrix (const var_value< T > &A, int m) |
| Creates a matrix_cl by replicating the input vector or row_vector. More... | |
| template<typename T , require_all_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_any_var_t< T > * = nullptr> | |
| auto | reverse (const T &m) |
| Return reversed view into the specified vector or row vector. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | round (const var_value< T > &A) |
Returns the elementwise round() of the input var_value<matrix_cl<double>>. More... | |
| template<typename T1 , typename T2 , require_any_var_t< T1, T2 > * = nullptr, require_all_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr> | |
| var_value< matrix_cl< double > > | rows_dot_product (T1 &&v1, T2 &&v2) |
| Returns the dot product of rows of the specified matrices. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | rows_dot_self (const var_value< T > &v) |
| Returns the dot product of each row of a matrix with itself. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var | sd (const var_value< T > &A) |
| Return the sample standard deviation of the var_value matrix. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | sin (const var_value< T > &A) |
Returns the elementwise cos() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | sinh (const var_value< T > &A) |
Returns the elementwise cos() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | softmax (const var_value< T > &A) |
| Returns softmax of given argument. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | sqrt (const var_value< T > &A) |
Returns the elementwise sqrt() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | square (const var_value< T > &A) |
Returns the elementwise square() of a var_value<matrix_cl<double>>. More... | |
| template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr> | |
| var_value< double > | squared_distance (T_a &&a, T_b &&b) |
| Returns the squared distance. More... | |
| template<typename T_a , typename T_b , require_all_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr, require_any_not_stan_scalar_t< T_a, T_b > * = nullptr> | |
| auto | subtract (T_a &&a, T_b &&b) |
| Subtraction of two reverse mode matrices and/or kernel generator expressions. More... | |
| template<typename T_a , typename T_b , require_all_nonscalar_prim_or_rev_kernel_expression_t< T_a, T_b > * = nullptr, require_any_var_t< T_a, T_b > * = nullptr> | |
| auto | operator- (const T_a &a, const T_b &b) |
| Subtraction of two reverse mode matrices and/or kernel generator expressions. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var | sum (const var_value< T > &x) |
| Returns the sum of the coefficients of the specified matrix on the OpenCL device. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | symmetrize_from_lower_tri (const var_value< T > &A) |
| Return a symmetric matrix using elements from the upper triangular part of the input matrix. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | symmetrize_from_upper_tri (const var_value< T > &A) |
| Return a symmetric matrix using elements from the upper triangular part of the input matrix. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | tan (const var_value< T > &A) |
Returns the elementwise tan() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | tanh (const var_value< T > &A) |
Returns the elementwise tanh() of a var_value<matrix_cl<double>> in radians. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | tcrossprod (const var_value< T > &M) |
| Returns the result of post-multiplying a matrix by its own transpose. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | tgamma (const var_value< T > &A) |
Returns the elementwise tgamma() of a var_value<matrix_cl<double>>. More... | |
| template<typename T , require_matrix_cl_t< T > * = nullptr> | |
| arena_t< T > | to_arena (const T &a) |
| Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered. More... | |
| template<typename T_x , require_all_kernel_expressions_and_none_scalar_t< T_x > * = nullptr> | |
| var_value< matrix_cl< double > > | to_matrix (const var_value< T_x > &x, int m, int n) |
| Returns a matrix representation of a vector or matrix in column-major order with the specified number of rows and columns. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var | trace (const var_value< T > &x) |
| Returns the trace (sum of diagonal) of the specified matrix on the OpenCL device. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| auto | transpose (const var_value< T > &M) |
| Transposes a matrix. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | trunc (const var_value< T > &A) |
Returns the elementwise trunc() of the input var_value<matrix_cl<double>>. More... | |
| template<typename T_x , typename T_ub , require_all_prim_or_rev_kernel_expression_t< T_x, T_ub > * = nullptr, require_any_var_t< T_x, T_ub > * = nullptr, require_any_not_stan_scalar_t< T_x, T_ub > * = nullptr> | |
| var_value< matrix_cl< double > > | ub_constrain (T_x &&x, T_ub &&ub) |
| Return the upper-bounded value for the specified unconstrained input and specified upper bound. More... | |
| template<typename T_x , typename T_ub , require_all_prim_or_rev_kernel_expression_t< T_x, T_ub > * = nullptr, require_any_var_t< T_x, T_ub > * = nullptr, require_any_not_stan_scalar_t< T_x, T_ub > * = nullptr> | |
| var_value< matrix_cl< double > > | ub_constrain (T_x &&x, T_ub &&ub, var &lp) |
| Return the upper-bounded value for the specified unconstrained input and specified upper bound. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | unit_vector_constrain (const var_value< T > &A) |
| Return the unit length vector corresponding to the free vector y. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var_value< matrix_cl< double > > | unit_vector_constrain (const var_value< T > &A, var &lp) |
| Return the unit length vector corresponding to the free vector y. More... | |
| template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr> | |
| var | variance (const var_value< T > &A) |
| Return the sample variance of the var_value matrix Raise domain error if size is not greater than zero. More... | |
| template<bool need_eigenvectors = true> | |
| void | symmetric_eigensolver (const matrix_cl< double > &A, matrix_cl< double > &eigenvalues, matrix_cl< double > &eigenvectors) |
| template<typename T > | |
| ref_type_for_opencl_t< T && > | to_ref_for_opencl (T &&a) |
Converts given Eigen expression into one that can be directly copied to an OpenCL device to create matrix_cl. More... | |
| template<matrix_cl_view matrix_view = matrix_cl_view::Entire, typename T , require_matrix_cl_st< std::is_floating_point, T > * = nullptr> | |
| plain_type_t< T > | tri_inverse (const T &A) |
| Computes the inverse of a triangular matrix. More... | |
| tbb::task_scheduler_init & | init_threadpool_tbb (int n_threads=0) |
| Initialize the Intel TBB threadpool and global scheduler through the tbb::task_scheduler_init object. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator+ (const std::complex< U > &x, const std::complex< V > &y) |
| Return the sum of the arguments. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator+ (const std::complex< U > &x, const V &y) |
| Return the sum of the arguments. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator+ (const U &x, const std::complex< V > &y) |
| Return the sum of the arguments. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator/ (const std::complex< U > &x, const std::complex< V > &y) |
| Return the quotient of the arguments. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator/ (const std::complex< U > &x, const V &y) |
| Return the quotient of the arguments. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator/ (const U &x, const std::complex< V > &y) |
| Return the quotient of the arguments. More... | |
| template<typename U , typename V , typename = require_any_autodiff_t<U, V>> | |
| bool | operator== (const std::complex< U > &x, const std::complex< V > &y) |
Return true if the complex numbers have equal imaginary and complex parts. More... | |
| template<typename U , typename V , typename = require_any_autodiff_t<U, V>> | |
| bool | operator== (const std::complex< U > &x, const V &y) |
Return true if the first argument's real part is equal to the second argument and the first argument's imaginary part is zero. More... | |
| template<typename U , typename V , typename = require_any_autodiff_t<U, V>> | |
| bool | operator== (const U &x, const std::complex< V > &y) |
Return true if the first argument is equal to the real part of the second argument and the imaginary part of the second argument is zero. More... | |
| template<typename U , require_autodiff_t< U > > | |
| std::complex< U > | operator- (const std::complex< U > &x) |
| Return the negation of the argument. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator* (const std::complex< U > &x, const std::complex< V > &y) |
| Return the product of the arguments. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator* (const std::complex< U > &x, const V &y) |
| Return the product of the arguments. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator* (const U &x, const std::complex< V > &y) |
| Return the product of the arguments. More... | |
| template<typename U , typename V , typename = require_any_autodiff_t<U, V>> | |
| bool | operator!= (const std::complex< U > &x, const std::complex< V > &y) |
Return true if the complex numbers have unequal imaginary or complex parts. More... | |
| template<typename U , typename V , typename = require_any_autodiff_t<U, V>> | |
| bool | operator!= (const std::complex< U > &x, const V &y) |
Return true if the first argument's real part is unequal to the second argument or the first argument's imaginary part is unequal to zero. More... | |
| template<typename U , typename V , typename = require_any_autodiff_t<U, V>> | |
| bool | operator!= (const U &x, const std::complex< V > &y) |
Return true if the first argument is unequal to the real part of the second argument or the imaginary part of the second argument is nonzero. More... | |
| template<typename U , require_autodiff_t< U > > | |
| std::complex< U > | operator+ (const std::complex< U > &x) |
| Return the argument. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator- (const std::complex< U > &x, const std::complex< V > &y) |
| Return the difference of the arguments. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator- (const std::complex< U > &x, const V &y) |
| Return the difference of the arguments. More... | |
| template<typename U , typename V > | |
| complex_return_t< U, V > | operator- (const U &x, const std::complex< V > &y) |
| Return the difference of the arguments. More... | |
| template<typename T_a1 , typename T_a2 , typename T_b1 , typename T_z > | |
| void | check_2F1_converges (const char *function, const T_a1 &a1, const T_a2 &a2, const T_b1 &b1, const T_z &z) |
| Check if the hypergeometric function (2F1) called with supplied arguments will converge, assuming arguments are finite values. More... | |
| template<typename T_a1 , typename T_a2 , typename T_a3 , typename T_b1 , typename T_b2 , typename T_z > | |
| void | check_3F2_converges (const char *function, const T_a1 &a1, const T_a2 &a2, const T_a3 &a3, const T_b1 &b1, const T_b2 &b2, const T_z &z) |
| Check if the hypergeometric function (3F2) called with supplied arguments will converge, assuming arguments are finite values. More... | |
| template<typename T_y , typename T_low , typename T_high > | |
| void | check_bounded (const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high) |
| Check if the value is between the low and high values, inclusively. More... | |
| template<typename Mat , require_matrix_t< Mat > * = nullptr> | |
| void | check_cholesky_factor (const char *function, const char *name, const Mat &y) |
| Throw an exception if the specified matrix is not a valid Cholesky factor. More... | |
| template<typename StdVec , require_std_vector_t< StdVec > * = nullptr> | |
| void | check_cholesky_factor (const char *function, const char *name, const StdVec &y) |
| Throw an exception if the specified matrix is not a valid Cholesky factor. More... | |
| template<typename Mat , require_matrix_t< Mat > * = nullptr> | |
| void | check_cholesky_factor_corr (const char *function, const char *name, const Mat &y) |
| Throw an exception if the specified matrix is not a valid Cholesky factor of a correlation matrix. More... | |
| template<typename StdVec , require_std_vector_t< StdVec > * = nullptr> | |
| void | check_cholesky_factor_corr (const char *function, const char *name, const StdVec &y) |
| Throw an exception if the specified matrix is not a valid Cholesky factor of a correlation matrix. More... | |
| template<typename T_y , require_any_t< is_matrix< T_y >, is_prim_or_rev_kernel_expression< T_y >> * = nullptr> | |
| void | check_column_index (const char *function, const char *name, const T_y &y, size_t i) |
| Check if the specified index is a valid column of the matrix. More... | |
| template<typename T > | |
| void | check_consistent_size (const char *function, const char *name, const T &x, size_t expected_size) |
Check if x is consistent with size expected_size. More... | |
| void | check_consistent_sizes (const char *) |
| Trivial no input case, this function is a no-op. More... | |
| template<typename T1 > | |
| void | check_consistent_sizes (const char *, const char *, const T1 &) |
| Base case of recursion, this function is a no-op. More... | |
| template<typename T1 , typename T2 , typename... Ts> | |
| void | check_consistent_sizes (const char *function, const char *name1, const T1 &x1, const char *name2, const T2 &x2, const Ts &...names_and_xs) |
| Check that the inputs are of consistent size. More... | |
| void | check_consistent_sizes_mvt (const char *) |
| Trivial no input case, this function is a no-op. More... | |
| template<typename T1 > | |
| void | check_consistent_sizes_mvt (const char *, const char *, const T1 &) |
| Base case of recursion, this function is a no-op. More... | |
| template<typename T1 , typename T2 , typename... Ts> | |
| void | check_consistent_sizes_mvt (const char *function, const char *name1, const T1 &x1, const char *name2, const T2 &x2, const Ts &...names_and_xs) |
| Check that the provided multivariate inputs are of consistent size with each other. More... | |
| template<typename Mat , require_matrix_t< Mat > * = nullptr> | |
| void | check_corr_matrix (const char *function, const char *name, const Mat &y) |
| Throw an exception if the specified matrix is not a valid correlation matrix. More... | |
| template<typename StdVec , require_std_vector_t< StdVec > * = nullptr> | |
| void | check_corr_matrix (const char *function, const char *name, const StdVec &y) |
| Throw an exception if the specified matrix is not a valid correlation matrix. More... | |
| template<typename Mat , require_matrix_t< Mat > * = nullptr> | |
| void | check_cov_matrix (const char *function, const char *name, const Mat &y) |
| Throw an exception if the specified matrix is not a valid covariance matrix. More... | |
| template<typename StdVec , require_std_vector_t< StdVec > * = nullptr> | |
| void | check_cov_matrix (const char *function, const char *name, const StdVec &y) |
| Throw an exception if the specified matrix is not a valid covariance matrix. More... | |
| template<typename T_y > | |
| void | check_finite (const char *function, const char *name, const T_y &y) |
Return true if all values in y are finite. More... | |
| void | check_flag_sundials (int flag, const char *func_name) |
| Throws a std::runtime_error exception when a Sundial function fails (i.e. More... | |
| void | check_flag_kinsol (int flag, long int max_num_steps) |
| Throws an exception message when the function KINSol() (call to the solver) fails. More... | |
| template<typename T_y , typename T_low , require_all_stan_scalar_t< T_y, T_low > * = nullptr, typename... Idxs> | |
| void | check_greater (const char *function, const char *name, const T_y &y, const T_low &low, Idxs...idxs) |
Throw an exception if y is not strictly greater than low. More... | |
| template<typename T_y , typename T_low , require_stan_scalar_t< T_y > * = nullptr, require_vector_t< T_low > * = nullptr, require_not_std_vector_vt< is_container_or_var_matrix, T_low > * = nullptr, typename... Idxs> | |
| void | check_greater (const char *function, const char *name, const T_y &y, const T_low &low, Idxs...idxs) |
Throw an exception if y is not strictly greater than each element of low. More... | |
| template<typename T_y , typename T_low , require_stan_scalar_t< T_y > * = nullptr, require_dense_dynamic_t< T_low > * = nullptr, typename... Idxs> | |
| void | check_greater (const char *function, const char *name, const T_y &y, const T_low &low, Idxs...idxs) |
Throw an exception if y is not strictly greater than each element of low. More... | |
| template<typename T_y , typename T_low , require_all_stan_scalar_t< T_y, T_low > * = nullptr, typename... Idxs> | |
| void | check_greater_or_equal (const char *function, const char *name, const T_y &y, const T_low &low, Idxs...idxs) |
Throw an exception if y is not greater or equal than low. More... | |
| template<typename T_y , typename T_low , require_stan_scalar_t< T_y > * = nullptr, require_vector_t< T_low > * = nullptr, require_not_std_vector_vt< is_container_or_var_matrix, T_low > * = nullptr, typename... Idxs> | |
| void | check_greater_or_equal (const char *function, const char *name, const T_y &y, const T_low &low, Idxs...idxs) |
Throw an exception if y is not greater or equal than each element of low. More... | |
| template<typename T_y , typename T_low , require_stan_scalar_t< T_y > * = nullptr, require_dense_dynamic_t< T_low > * = nullptr, typename... Idxs> | |
| void | check_greater_or_equal (const char *function, const char *name, const T_y &y, const T_low &low, Idxs...idxs) |
Throw an exception if y is not greater or equal than each element of low. More... | |
| template<typename T > | |
| void | check_ldlt_factor (const char *function, const char *name, LDLT_factor< T > &A) |
| Raise domain error if the specified LDLT factor is invalid. More... | |
| template<typename T_y , typename T_high , require_all_stan_scalar_t< T_y, T_high > * = nullptr, typename... Idxs> | |
| void | check_less (const char *function, const char *name, const T_y &y, const T_high &high, Idxs...idxs) |
Throw an exception if y is not strictly less than high. More... | |
| template<typename T_y , typename T_high , require_stan_scalar_t< T_y > * = nullptr, require_vector_t< T_high > * = nullptr, require_not_std_vector_vt< is_container_or_var_matrix, T_high > * = nullptr, typename... Idxs> | |
| void | check_less (const char *function, const char *name, const T_y &y, const T_high &high, Idxs...idxs) |
Throw an exception if y is not strictly less than each element of high. More... | |
| template<typename T_y , typename T_high , require_stan_scalar_t< T_y > * = nullptr, require_dense_dynamic_t< T_high > * = nullptr, typename... Idxs> | |
| void | check_less (const char *function, const char *name, const T_y &y, const T_high &high, Idxs...idxs) |
Throw an exception if y is not strictly less than each element of high. More... | |
| template<typename T_y , typename T_high , require_all_stan_scalar_t< T_y, T_high > * = nullptr, typename... Idxs> | |
| void | check_less_or_equal (const char *function, const char *name, const T_y &y, const T_high &high, Idxs...idxs) |
Throw an exception if y is not less than high. More... | |
| template<typename T_y , typename T_high , require_stan_scalar_t< T_y > * = nullptr, require_vector_t< T_high > * = nullptr, require_not_std_vector_vt< is_container_or_var_matrix, T_high > * = nullptr, typename... Idxs> | |
| void | check_less_or_equal (const char *function, const char *name, const T_y &y, const T_high &high, Idxs...idxs) |
Throw an exception if y is not less than each element of high. More... | |
| template<typename T_y , typename T_high , require_stan_scalar_t< T_y > * = nullptr, require_dense_dynamic_t< T_high > * = nullptr, typename... Idxs> | |
| void | check_less_or_equal (const char *function, const char *name, const T_y &y, const T_high &high, Idxs...idxs) |
Throw an exception if y is not less than each element of high. More... | |
| template<typename T_y , require_eigen_t< T_y > * = nullptr> | |
| void | check_lower_triangular (const char *function, const char *name, const T_y &y) |
| Check if the specified matrix is lower triangular. More... | |
| template<typename T1 , typename T2 , require_all_not_matrix_t< T1, T2 > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr> | |
| void | check_matching_dims (const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2) |
| Check if the two containers have the same dimensions. More... | |
| template<bool check_compile, typename Mat1 , typename Mat2 , typename = require_all_eigen_t<Mat1, Mat2>> | |
| void | check_matching_dims (const char *function, const char *name1, const Mat1 &y1, const char *name2, const Mat2 &y2) |
| Check if the two matrices are of the same size. More... | |
| template<typename T_y1 , typename T_y2 > | |
| void | check_matching_sizes (const char *function, const char *name1, const T_y1 &y1, const char *name2, const T_y2 &y2) |
| Check if two structures at the same size. More... | |
| template<typename T1 , typename T2 > | |
| void | check_multiplicable (const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2) |
| Check if the matrices can be multiplied. More... | |
| template<typename T_y > | |
| void | check_nonnegative (const char *function, const char *name, const T_y &y) |
Check if y is non-negative. More... | |
| template<typename T_y > | |
| void | check_nonzero_size (const char *function, const char *name, const T_y &y) |
| Check if the specified matrix/vector is of non-zero size. More... | |
| template<typename T_y > | |
| void | check_not_nan (const char *function, const char *name, const T_y &y) |
Check if y is not NaN. More... | |
| template<typename T_y , require_vector_t< T_y > * = nullptr, require_not_std_vector_t< T_y > * = nullptr> | |
| void | check_ordered (const char *function, const char *name, const T_y &y) |
| Throw an exception if the specified vector is not sorted into strictly increasing order. More... | |
| template<typename T_y , require_std_vector_vt< is_stan_scalar, T_y > * = nullptr> | |
| void | check_ordered (const char *function, const char *name, const T_y &y) |
| Throw an exception if the specified vector is not sorted into strictly increasing order. More... | |
| template<typename EigMat , require_matrix_t< EigMat > * = nullptr> | |
| void | check_pos_definite (const char *function, const char *name, const EigMat &y) |
| Check if the specified square, symmetric matrix is positive definite. More... | |
| template<typename Derived > | |
| void | check_pos_definite (const char *function, const char *name, const Eigen::LDLT< Derived > &cholesky) |
| Check if the specified LDLT decomposition of a matrix is positive definite. More... | |
| template<typename Derived > | |
| void | check_pos_definite (const char *function, const char *name, const Eigen::LLT< Derived > &cholesky) |
| Check if the specified LLT decomposition was successful. More... | |
| template<typename EigMat , require_matrix_t< EigMat > * = nullptr> | |
| void | check_pos_semidefinite (const char *function, const char *name, const EigMat &y) |
| Check if the specified matrix is positive definite. More... | |
| template<typename Derived > | |
| void | check_pos_semidefinite (const char *function, const char *name, const Eigen::LDLT< Derived > &cholesky) |
| Check if the specified matrix is positive semidefinite. More... | |
| template<typename T_y > | |
| void | check_positive (const char *function, const char *name, const T_y &y) |
Check if y is positive. More... | |
| void | check_positive (const char *function, const char *name, const char *expr, int size) |
Check if size is positive. More... | |
| template<typename T_y > | |
| void | check_positive_finite (const char *function, const char *name, const T_y &y) |
Check if y is positive and finite. More... | |
| template<typename Vec , require_vector_t< Vec > * = nullptr, require_not_std_vector_t< Vec > * = nullptr> | |
| void | check_positive_ordered (const char *function, const char *name, const Vec &y) |
| Throw an exception if the specified the vector contains negative values or is not sorted into strictly increasing order. More... | |
| template<typename StdVec , require_std_vector_t< StdVec > * = nullptr> | |
| void | check_positive_ordered (const char *function, const char *name, const StdVec &y) |
| Throw an exception if any of the vectors in a standard vector contains negative values or is not sorted into strictly increasing order. More... | |
| void | check_range (const char *function, const char *name, int max, int index, int nested_level, const char *error_msg) |
| Check if specified index is within range. More... | |
| void | check_range (const char *function, const char *name, int max, int index, const char *error_msg) |
| Check if specified index is within range. More... | |
| void | check_range (const char *function, const char *name, int max, int index) |
| Check if specified index is within range. More... | |
| template<typename T_y , typename = require_matrix_t<T_y>> | |
| void | check_row_index (const char *function, const char *name, const T_y &y, size_t i) |
| Check if the specified index is a valid row of the matrix This check is 1-indexed by default. More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| void | check_simplex (const char *function, const char *name, const T &theta) |
| Throw an exception if the specified vector is not a simplex. More... | |
| template<typename T_size1 , typename T_size2 > | |
| void | check_size_match (const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j) |
| Check if the provided sizes match. More... | |
| template<typename T_size1 , typename T_size2 > | |
| void | check_size_match (const char *function, const char *expr_i, const char *name_i, T_size1 i, const char *expr_j, const char *name_j, T_size2 j) |
| Check if the provided sizes match. More... | |
| template<typename EigVec , require_eigen_vector_t< EigVec > * = nullptr> | |
| void | check_sorted (const char *function, const char *name, const EigVec &y) |
| Check if the specified vector is sorted into increasing order (repeated values are okay). More... | |
| template<typename T_y > | |
| void | check_sorted (const char *function, const char *name, const std::vector< T_y > &y) |
| Check if the specified vector is sorted into increasing order (repeated values are okay). More... | |
| template<typename T_y , require_any_t< is_matrix< T_y >, is_prim_or_rev_kernel_expression< T_y >> * = nullptr> | |
| void | check_square (const char *function, const char *name, const T_y &y) |
| Check if the specified matrix is square. More... | |
| template<typename T > | |
| void | check_std_vector_index (const char *function, const char *name, const std::vector< T > &y, int i) |
| Check if the specified index is valid in std vector This check is 1-indexed by default. More... | |
| template<typename EigMat , require_matrix_t< EigMat > * = nullptr> | |
| void | check_symmetric (const char *function, const char *name, const EigMat &y) |
| Check if the specified matrix is symmetric. More... | |
| template<typename Vec , require_vector_t< Vec > * = nullptr, require_not_std_vector_t< Vec > * = nullptr> | |
| void | check_unit_vector (const char *function, const char *name, const Vec &theta) |
| Throw an exception if the specified vector does not have unit Euclidiean length. More... | |
| template<typename StdVec , require_std_vector_t< StdVec > * = nullptr> | |
| void | check_unit_vector (const char *function, const char *name, const StdVec &theta) |
| Throw an exception if the each element in a standard vector does not have unit Euclidiean length. More... | |
| template<typename Mat , require_any_t< is_matrix< Mat >, is_prim_or_rev_kernel_expression< Mat >> * = nullptr> | |
| void | check_vector (const char *function, const char *name, const Mat &x) |
| Check the input is either a row vector or column vector or a matrix with a single row or column. More... | |
| template<typename T , require_any_t< is_vector< T >, is_prim_or_rev_kernel_expression< T >> * = nullptr> | |
| void | check_vector_index (const char *function, const char *name, const T &y, size_t i) |
| Check if the specified index is a valid element of the row or column vector This check is 1-indexed by default. More... | |
| template<typename T > | |
| void | domain_error (const char *function, const char *name, const T &y, const char *msg1, const char *msg2) |
| template<typename T > | |
| void | domain_error (const char *function, const char *name, const T &y, const char *msg1) |
| template<typename T > | |
| void | domain_error_vec (const char *function, const char *name, const T &y, size_t i, const char *msg1, const char *msg2) |
| template<typename T > | |
| void | domain_error_vec (const char *function, const char *name, const T &y, size_t i, const char *msg1) |
| template<typename F , typename T , typename... Indexings, require_stan_scalar_t< T > * = nullptr> | |
| void | elementwise_check (const F &is_good, const char *function, const char *name, const T &x, const char *must_be, const Indexings &...indexings) |
Check that the predicate holds for the value of x. More... | |
| template<typename F , typename T , typename... Indexings, require_eigen_t< T > * = nullptr, std::enable_if_t<(Eigen::internal::traits< T >::Flags &Eigen::LinearAccessBit)||T::IsVectorAtCompileTime > * = nullptr> | |
| void | elementwise_check (const F &is_good, const char *function, const char *name, const T &x, const char *must_be, const Indexings &...indexings) |
Check that the predicate holds for all elements of the value of x. More... | |
| template<typename F , typename T > | |
| bool | elementwise_is (const F &is_good, const T &x) |
Check that the predicate holds for the value of x, working elementwise on containers. More... | |
| template<typename T_omega , typename T_Gamma , typename T_rho , require_all_eigen_t< T_omega, T_Gamma > * = nullptr, require_eigen_col_vector_t< T_rho > * = nullptr> | |
| void | hmm_check (const T_omega &log_omegas, const T_Gamma &Gamma, const T_rho &rho, const char *function) |
| Check arguments for hidden Markov model functions with a discrete latent state (lpdf, rng for latent states, and marginal probabilities for latent sates). More... | |
| template<typename T > | |
| void | invalid_argument (const char *function, const char *name, const T &y, const char *msg1, const char *msg2) |
| Throw an invalid_argument exception with a consistently formatted message. More... | |
| template<typename T > | |
| void | invalid_argument (const char *function, const char *name, const T &y, const char *msg1) |
| Throw an invalid_argument exception with a consistently formatted message. More... | |
| template<typename T > | |
| void | invalid_argument_vec (const char *function, const char *name, const T &y, size_t i, const char *msg1, const char *msg2) |
| Throw an invalid argument exception with a consistently formatted message. More... | |
| template<typename T > | |
| void | invalid_argument_vec (const char *function, const char *name, const T &y, size_t i, const char *msg) |
| Throw an invalid argument exception with a consistently formatted message. More... | |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr> | |
| bool | is_cholesky_factor (const EigMat &y) |
Return true if y is a valid Cholesky factor, if number of rows is not less than the number of columns, if there are no 0 columns, and no element in matrix is NaN. More... | |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr> | |
| bool | is_cholesky_factor_corr (const EigMat &y) |
Return true if y is a valid Cholesky factor, if the number of rows is not less than the number of columns, if there are no zero columns, and no element in matrix is NaN. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| bool | is_column_index (const EigMat &y, size_t i) |
Return true if column index is in bounds. More... | |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr> | |
| bool | is_corr_matrix (const EigMat &y) |
Return true if the matrix is square and not 0x0, if the matrix is symmetric, diagonals are near 1, positive definite, and no elements are NaN A valid correlation matrix is symmetric, has a unit diagonal (all 1 values), and has all values between -1 and 1 (inclusive). More... | |
| template<typename T > | |
| bool | is_ldlt_factor (LDLT_factor< T > &A) |
Return true if the specified LDLT factor is invalid. More... | |
| template<typename T_y , typename T_high > | |
| bool | is_less_or_equal (const T_y &y, const T_high &high) |
Return true if y is less or equal to high. More... | |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr> | |
| bool | is_lower_triangular (const EigMat &y) |
Return true is matrix is lower triangular. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| bool | is_mat_finite (const EigMat &y) |
Return true is the specified matrix is finite. More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_matrix_t< EigMat1, EigMat2 > * = nullptr> | |
| bool | is_matching_dims (const EigMat1 &y1, const EigMat2 &y2) |
Return true if the two matrices are of the same size. More... | |
| template<bool check_compile, typename EigMat1 , typename EigMat2 , require_all_matrix_t< EigMat1, EigMat2 > * = nullptr> | |
| bool | is_matching_dims (const EigMat1 &y1, const EigMat2 &y2) |
Return true if the two matrices are of the same size. More... | |
| template<typename T_y1 , typename T_y2 > | |
| bool | is_matching_size (const T_y1 &y1, const T_y2 &y2) |
Return true if two structures are the same size. More... | |
| template<typename T_y > | |
| bool | is_nonzero_size (const T_y &y) |
Returns true if the specified matrix/vector is size nonzero. More... | |
| template<typename T_y > | |
| bool | is_not_nan (const T_y &y) |
Return true if y is not NaN. More... | |
| template<typename T_y > | |
| bool | is_ordered (const std::vector< T_y > &y) |
Return true if the vector is sorted into strictly increasing order. More... | |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr> | |
| bool | is_pos_definite (const EigMat &y) |
Return true if the matrix is square or if the matrix has non-zero size, or if the matrix is symmetric, or if it is positive definite, or if no element is NaN. More... | |
| template<typename Derived > | |
| bool | is_pos_definite (const Eigen::LDLT< Derived > &cholesky) |
Return true if the matrix is positive definite. More... | |
| template<typename Derived > | |
| bool | is_pos_definite (const Eigen::LLT< Derived > &cholesky) |
Return true if diagonal of the L matrix is positive. More... | |
| template<typename T_y > | |
| bool | is_positive (const T_y &y) |
Return true if y is positive. More... | |
| bool | is_positive (int size) |
Return true if size is positive. More... | |
| template<typename T_y > | |
| bool | is_scal_finite (const T_y &y) |
Return true if y is finite. More... | |
| template<typename T_size1 , typename T_size2 > | |
| bool | is_size_match (T_size1 i, T_size2 j) |
Return true if the provided sizes match. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| bool | is_square (const EigMat &y) |
Return true if the matrix is square. More... | |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr> | |
| bool | is_symmetric (const EigMat &y) |
Return true if the matrix is square, and no element not on the main diagonal is NaN. More... | |
| template<typename EigVec , require_eigen_vector_t< EigVec > * = nullptr> | |
| bool | is_unit_vector (const EigVec &theta) |
Return true if the vector is not a unit vector or if any element is NaN. More... | |
| void | out_of_range (const char *function, int max, int index, const char *msg1="", const char *msg2="") |
| Throw an out_of_range exception with a consistently formatted message. More... | |
| void | system_error (const char *function, const char *name, const int &y, const char *msg1, const char *msg2) |
| Throw a system error with a consistently formatted message. More... | |
| void | system_error (const char *function, const char *name, const int &y, const char *msg1) |
| Throw a system error with a consistently formatted message. More... | |
| template<typename T > | |
| void | throw_domain_error (const char *function, const char *name, const T &y, const char *msg1, const char *msg2) |
| Throw a domain error with a consistently formatted message. More... | |
| template<typename T > | |
| void | throw_domain_error (const char *function, const char *name, const T &y, const char *msg1) |
| Throw a domain error with a consistently formatted message. More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| void | throw_domain_error_mat (const char *function, const char *name, const T &y, size_t i, size_t j, const char *msg1, const char *msg2) |
| Throw a domain error with a consistently formatted message for matrices. More... | |
| template<typename T > | |
| void | throw_domain_error_mat (const char *function, const char *name, const T &y, size_t i, size_t j, const char *msg) |
| Throw a domain error with a consistently formatted message for matrices. More... | |
| template<typename T > | |
| void | throw_domain_error_vec (const char *function, const char *name, const T &y, size_t i, const char *msg1, const char *msg2) |
| Throw a domain error with a consistently formatted message. More... | |
| template<typename T > | |
| void | throw_domain_error_vec (const char *function, const char *name, const T &y, size_t i, const char *msg) |
| Throw a domain error with a consistently formatted message. More... | |
| void | validate_non_negative_index (const char *var_name, const char *expr, int val) |
| void | validate_positive_index (const char *var_name, const char *expr, int val) |
| Check that simplex is at least size 1. More... | |
| void | validate_unit_vector_index (const char *var_name, const char *expr, int val) |
| Check that unit vector is at least size 2. More... | |
| template<typename T , require_arithmetic_t< T > * = nullptr> | |
| T | abs (T x) |
| Return the absolute value of the specified arithmetic argument. More... | |
| template<typename T > | |
| std::vector< T > | abs (const std::vector< T > &x) |
| template<typename T , int R, int C> | |
| Eigen::Matrix< T, R, C > | abs (const Eigen::Matrix< T, R, C > &x) |
| Return the elementwise absolute value of the specified matrix, vector, or row vector. More... | |
| template<typename T , require_complex_t< T > * = nullptr> | |
| auto | abs (T x) |
| Return the absolute value (also known as the norm, modulus, or magnitude) of the specified complex argument. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | acos (const Container &x) |
Returns the elementwise acos() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | acos (const Container &x) |
Version of acos() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| double | acosh (double x) |
| Return the inverse hyperbolic cosine of the specified value. More... | |
| double | acosh (int x) |
| Integer version of acosh. More... | |
| template<typename T , require_not_var_matrix_t< T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | acosh (const T &x) |
Return the elementwise application of acosh() to specified argument container. More... | |
| template<typename ScalarA , typename ScalarB , require_all_stan_scalar_t< ScalarA, ScalarB > * = nullptr, require_all_not_var_t< ScalarA, ScalarB > * = nullptr> | |
| return_type_t< ScalarA, ScalarB > | add (const ScalarA &a, const ScalarB &b) |
| Return the sum of the specified scalars. More... | |
| template<typename Mat1 , typename Mat2 , require_all_eigen_t< Mat1, Mat2 > * = nullptr, require_all_not_st_var< Mat1, Mat2 > * = nullptr> | |
| auto | add (const Mat1 &m1, const Mat2 &m2) |
| Return the sum of the specified matrices. More... | |
| template<typename Mat , typename Scal , require_eigen_t< Mat > * = nullptr, require_stan_scalar_t< Scal > * = nullptr, require_all_not_st_var< Mat, Scal > * = nullptr> | |
| auto | add (const Mat &m, const Scal c) |
| Return the sum of the specified matrix and specified scalar. More... | |
| template<typename Scal , typename Mat , require_stan_scalar_t< Scal > * = nullptr, require_eigen_t< Mat > * = nullptr, require_all_not_st_var< Scal, Mat > * = nullptr> | |
| auto | add (const Scal c, const Mat &m) |
| Return the sum of the specified scalar and specified matrix. More... | |
| template<typename T_m , typename T_a , typename = require_eigen_t<T_m>, typename = require_any_t<is_eigen_vector<T_a>, is_stan_scalar<T_a>>> | |
| Eigen::Matrix< return_type_t< T_m, T_a >, Eigen::Dynamic, Eigen::Dynamic > | add_diag (const T_m &mat, const T_a &to_add) |
| Returns a Matrix with values added along the main diagonal. More... | |
| template<typename T1 , typename T2 > | |
| append_return_type< std::vector< T1 >, std::vector< T2 > >::type | append_array (const std::vector< T1 > &x, const std::vector< T2 > &y) |
| Return the concatenation of two specified vectors in the order of the arguments. More... | |
| template<typename T1 > | |
| std::vector< T1 > | append_array (const std::vector< T1 > &x, const std::vector< T1 > &y) |
| Return the concatenation of two specified vectors in the order of the arguments. More... | |
| template<typename T1 , typename T2 , typename = require_all_eigen_t<T1, T2>> | |
| auto | append_col (const T1 &A, const T2 &B) |
| Return the result of appending the second argument matrix after the first argument matrix, that is, putting them side by side, with the first matrix followed by the second matrix. More... | |
| template<typename Scal , typename RowVec , require_stan_scalar_t< Scal > * = nullptr, require_t< is_eigen_row_vector< RowVec >> * = nullptr> | |
| Eigen::Matrix< return_type_t< Scal, RowVec >, 1, Eigen::Dynamic > | append_col (const Scal &A, const RowVec &B) |
| Return the result of stacking an scalar on top of the a row vector, with the result being a row vector. More... | |
| template<typename RowVec , typename Scal , require_t< is_eigen_row_vector< RowVec >> * = nullptr, require_stan_scalar_t< Scal > * = nullptr> | |
| Eigen::Matrix< return_type_t< RowVec, Scal >, 1, Eigen::Dynamic > | append_col (const RowVec &A, const Scal &B) |
| Return the result of stacking a row vector on top of the an scalar, with the result being a row vector. More... | |
| template<typename T1 , typename T2 , require_all_eigen_t< T1, T2 > * = nullptr> | |
| auto | append_row (const T1 &A, const T2 &B) |
| Return the result of stacking the rows of the first argument matrix on top of the second argument matrix. More... | |
| template<typename Scal , typename ColVec , require_stan_scalar_t< Scal > * = nullptr, require_t< is_eigen_col_vector< ColVec >> * = nullptr> | |
| Eigen::Matrix< return_type_t< Scal, ColVec >, Eigen::Dynamic, 1 > | append_row (const Scal &A, const ColVec &B) |
| Return the result of stacking an scalar on top of the a vector, with the result being a vector. More... | |
| template<typename ColVec , typename Scal , require_t< is_eigen_col_vector< ColVec >> * = nullptr, require_stan_scalar_t< Scal > * = nullptr> | |
| Eigen::Matrix< return_type_t< ColVec, Scal >, Eigen::Dynamic, 1 > | append_row (const ColVec &A, const Scal &B) |
| Return the result of stacking a vector on top of the an scalar, with the result being a vector. More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| T | as_array_or_scalar (T &&v) |
| Returns specified input value. More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| T & | as_array_or_scalar (T &v) |
| Returns a reference to rvalue specified input value. More... | |
| template<typename T , typename = require_eigen_t<T>, require_not_eigen_array_t< T > * = nullptr> | |
| auto | as_array_or_scalar (T &&v) |
| Converts a matrix type to an array. More... | |
| template<typename T > | |
| bool | as_bool (const T &x) |
Return true if the argument is not equal to zero (in the != operator sense) and false otherwise. More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| T | as_column_vector_or_scalar (const T &a) |
| no-op that passes the scalar More... | |
| template<typename T , typename S > | |
| internal::empty_broadcast_array< T, S, void > & | as_column_vector_or_scalar (internal::empty_broadcast_array< T, S, void > &a) |
| No-op used when working with operands and partials. More... | |
| template<typename T , require_eigen_col_vector_t< T > * = nullptr> | |
| T && | as_column_vector_or_scalar (T &&a) |
| no-op that returns a column vector. More... | |
| template<typename T , require_eigen_row_vector_t< T > * = nullptr, require_not_eigen_col_vector_t< T > * = nullptr> | |
| auto | as_column_vector_or_scalar (T &&a) |
| Converts a row vector to an eigen column vector. More... | |
| template<typename T > | |
| auto | as_value_array_or_scalar (T &&v) |
| Extract the value from an object. More... | |
| template<typename T > | |
| auto | as_value_column_array_or_scalar (T &&a) |
Extract the value from an object and for eigen vectors and std::vectors convert to an eigen column array and for scalars return a scalar. More... | |
| template<typename T > | |
| auto | as_value_column_vector_or_scalar (T &&a) |
| Extract values from input argument and transform to a column vector. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | asin (const Container &x) |
Returns the elementwise asin() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | asin (const Container &x) |
Version of asin() that accepts std::vectors, Eigen Matrix/Array objects, or expressions, and containers of these. More... | |
| template<typename T , require_not_var_matrix_t< T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | asinh (const T &x) |
Returns the elementwise asinh() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<int N> | |
| void | print_mat_size (std::ostream &o) |
| Helper function to return the matrix size as either "dynamic" or "1". More... | |
| template<typename T_lhs , typename T_rhs , require_all_stan_scalar_t< T_lhs, T_rhs > * = nullptr> | |
| void | assign (T_lhs &x, const T_rhs &y) |
| Copy the right-hand side's value to the left-hand side variable. More... | |
| template<typename T_lhs , typename T_rhs , require_all_eigen_t< T_lhs, T_rhs > * = nullptr> | |
| void | assign (T_lhs &&x, const T_rhs &y) |
| Copy the right-hand side's value to the left-hand side variable. More... | |
| template<typename T_lhs , typename T_rhs > | |
| void | assign (std::vector< T_lhs > &x, const std::vector< T_rhs > &y) |
| Copy the right-hand side's value to the left-hand side variable. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | atan (const Container &x) |
Returns the elementwise atan() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | atan (const Container &x) |
| Version of atan() that accepts std::vectors, Eigen Matrix/Array objects, or expressions, and containers of these. More... | |
| double | atanh (double x) |
| Return the inverse hyperbolic tangent of the specified value. More... | |
| double | atanh (int x) |
| Integer version of atanh. More... | |
| template<typename T , require_not_var_matrix_t< T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | atanh (const T &x) |
Return the elementwise application of atanh() to specified argument container. More... | |
| template<typename T > | |
| void | autocorrelation (const std::vector< T > &y, std::vector< T > &ac, Eigen::FFT< T > &fft) |
| Write autocorrelation estimates for every lag for the specified input sequence into the specified result using the specified FFT engine. More... | |
| template<typename T , typename DerivedA , typename DerivedB > | |
| void | autocorrelation (const Eigen::MatrixBase< DerivedA > &y, Eigen::MatrixBase< DerivedB > &ac, Eigen::FFT< T > &fft) |
| Write autocorrelation estimates for every lag for the specified input sequence into the specified result using the specified FFT engine. More... | |
| template<typename T > | |
| void | autocorrelation (const std::vector< T > &y, std::vector< T > &ac) |
| Write autocorrelation estimates for every lag for the specified input sequence into the specified result. More... | |
| template<typename T , typename DerivedA , typename DerivedB > | |
| void | autocorrelation (const Eigen::MatrixBase< DerivedA > &y, Eigen::MatrixBase< DerivedB > &ac) |
| Write autocorrelation estimates for every lag for the specified input sequence into the specified result. More... | |
| template<typename T > | |
| void | autocovariance (const std::vector< T > &y, std::vector< T > &acov, Eigen::FFT< T > &fft) |
| Write autocovariance estimates for every lag for the specified input sequence into the specified result using the specified FFT engine. More... | |
| template<typename T , typename DerivedA , typename DerivedB > | |
| void | autocovariance (const Eigen::MatrixBase< DerivedA > &y, Eigen::MatrixBase< DerivedB > &acov, Eigen::FFT< T > &fft) |
| Write autocovariance estimates for every lag for the specified input sequence into the specified result using the specified FFT engine. More... | |
| template<typename T > | |
| void | autocovariance (const std::vector< T > &y, std::vector< T > &acov) |
| Write autocovariance estimates for every lag for the specified input sequence into the specified result. More... | |
| template<typename T , typename DerivedA , typename DerivedB > | |
| void | autocovariance (const Eigen::MatrixBase< DerivedA > &y, Eigen::MatrixBase< DerivedB > &acov) |
| Write autocovariance estimates for every lag for the specified input sequence into the specified result. More... | |
| template<typename T2 , require_arithmetic_t< T2 > * = nullptr> | |
| T2 | bessel_first_kind (int v, const T2 z) |
\[ \mbox{bessel\_first\_kind}(v, x) = \begin{cases} J_v(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{error} & \mbox{if } x = \textrm{NaN} \end{cases} \] More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr, require_not_var_matrix_t< T2 > * = nullptr> | |
| auto | bessel_first_kind (const T1 &a, const T2 &b) |
| Enables the vectorised application of the bessel first kind function, when the first and/or second arguments are containers. More... | |
| template<typename T2 , require_arithmetic_t< T2 > * = nullptr> | |
| T2 | bessel_second_kind (int v, const T2 z) |
\[ \mbox{bessel\_second\_kind}(v, x) = \begin{cases} \textrm{error} & \mbox{if } x \leq 0 \\ Y_v(x) & \mbox{if } x > 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \] More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | bessel_second_kind (const T1 &a, const T2 &b) |
| Enables the vectorised application of the bessel second kind function, when the first and/or second arguments are containers. More... | |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| return_type_t< T1, T2 > | beta (const T1 a, const T2 b) |
| Return the beta function applied to the specified arguments. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr, require_all_not_var_matrix_t< T1, T2 > * = nullptr> | |
| auto | beta (const T1 &a, const T2 &b) |
| Enables the vectorised application of the beta function, when the first and/or second arguments are containers. More... | |
| template<typename T , require_arithmetic_t< T > * = nullptr> | |
| T | binary_log_loss (int y, const T &y_hat) |
| Returns the log loss function for binary classification with specified reference and response values. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr, require_not_var_matrix_t< T2 > * = nullptr> | |
| auto | binary_log_loss (const T1 &a, const T2 &b) |
| Enables the vectorised application of the binary log loss function, when the first and/or second arguments are containers. More... | |
| template<typename T_n , typename T_k , require_all_stan_scalar_t< T_n, T_k > * = nullptr> | |
| return_type_t< T_n, T_k > | binomial_coefficient_log (const T_n n, const T_k k) |
| Return the log of the binomial coefficient for the specified arguments. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | binomial_coefficient_log (const T1 &a, const T2 &b) |
| Enables the vectorised application of the binomial coefficient log function, when the first and/or second arguments are containers. More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| auto | block (const T &m, size_t i, size_t j, size_t nrows, size_t ncols) |
| Return a nrows x ncols submatrix starting at (i-1, j-1). More... | |
| template<typename T , require_not_var_matrix_t< T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | cbrt (const T &x) |
Returns the elementwise cbrt() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | ceil (const Container &x) |
Returns the elementwise ceil() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| plain_type_t< T > | chol2inv (const T &L) |
| Returns the inverse of the matrix whose Cholesky factor is L. More... | |
| template<typename EigVec , require_eigen_col_vector_t< EigVec > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigVec >, Eigen::Dynamic, Eigen::Dynamic > | cholesky_corr_constrain (const EigVec &y, int K) |
| template<typename EigVec , require_eigen_vector_t< EigVec > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigVec >, Eigen::Dynamic, Eigen::Dynamic > | cholesky_corr_constrain (const EigVec &y, int K, return_type_t< EigVec > &lp) |
| template<bool Jacobian, typename T , require_not_std_vector_t< T > * = nullptr> | |
| auto | cholesky_corr_constrain (const T &y, int K, return_type_t< T > &lp) |
Return The cholesky of a KxK correlation matrix. More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| auto | cholesky_corr_free (const T &x) |
Overload of cholesky_corr_free() to untransform each matrix in a standard vector. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr, require_not_eigen_vt< is_var, EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::ColsAtCompileTime > | cholesky_decompose (const EigMat &m) |
| Return the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric matrix. More... | |
| template<typename T , require_eigen_col_vector_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | cholesky_factor_constrain (const T &x, int M, int N) |
| Return the Cholesky factor of the specified size read from the specified vector. More... | |
| template<typename T , require_eigen_vector_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | cholesky_factor_constrain (const T &x, int M, int N, return_type_t< T > &lp) |
| Return the Cholesky factor of the specified size read from the specified vector and increment the specified log probability reference with the log absolute Jacobian determinant adjustment of the transform. More... | |
| template<bool Jacobian, typename T , require_not_std_vector_t< T > * = nullptr> | |
| auto | cholesky_factor_constrain (const T &x, int M, int N, return_type_t< T > &lp) |
| Return the Cholesky factor of the specified size read from the specified vector. More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, 1 > | cholesky_factor_free (const T &y) |
| Return the unconstrained vector of parameters corresponding to the specified Cholesky factor. More... | |
| template<typename T , require_std_vector_t< T > * = nullptr> | |
| auto | cholesky_factor_free (const T &x) |
Overload of cholesky_factor_free() to untransform each matrix in a standard vector. More... | |
| int | choose (int n, int k) |
| Return the binomial coefficient for the specified integer arguments. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | choose (const T1 &a, const T2 &b) |
| Enables the vectorised application of the binomial coefficient function, when the first and/or second arguments are containers. More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| auto | col (const T &m, size_t j) |
| Return the specified column of the specified matrix using start-at-1 indexing. More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| Eigen::Index | cols (const T &m) |
| Return the number of columns in the specified matrix, vector, or row vector. More... | |
| template<typename Mat1 , typename Mat2 , require_all_eigen_t< Mat1, Mat2 > * = nullptr, require_all_not_eigen_vt< is_var, Mat1, Mat2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< Mat1, Mat2 >, 1, Mat1::ColsAtCompileTime > | columns_dot_product (const Mat1 &v1, const Mat2 &v2) |
| Returns the dot product of columns of the specified matrices. More... | |
| template<typename T , require_eigen_t< T > * = nullptr, require_not_eigen_vt< is_var, T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, 1, T::ColsAtCompileTime > | columns_dot_self (const T &x) |
| Returns the dot product of each column of a matrix with itself. More... | |
| static constexpr double | e () |
| Return the base of the natural logarithm. More... | |
| static constexpr double | egamma () |
| Return the Euler's gamma constant. More... | |
| static constexpr double | pi () |
| Return the value of pi. More... | |
| static constexpr double | positive_infinity () |
| Return positive infinity. More... | |
| static constexpr double | negative_infinity () |
| Return negative infinity. More... | |
| static constexpr double | not_a_number () |
| Return (quiet) not-a-number. More... | |
| static constexpr double | machine_precision () |
| Returns the difference between 1.0 and the next value representable. More... | |
| static constexpr double | log10 () |
| Returns the natural logarithm of ten. More... | |
| static constexpr double | sqrt2 () |
| Returns the square root of two. More... | |
| template<typename T , typename U > | |
| T | copysign (const T &x, const U &y) |
| Return the negation of the first argument if the first and second argument have different signs, otherwise return a copy of the first argument. More... | |
| template<typename T , typename U > | |
| T | copysign_non_zero (const T &x, const U &y) |
| Return the negation of the first argument if the first and second arguments have different signs and the first argument is not zero, otherwise return a copy of the first argument. More... | |
| template<typename T , typename U > | |
| std::complex< T > | copysign (const std::complex< T > &x, const std::complex< U > &y) |
| Return the complex number composed of the real and complex parts with signs copied from the real and complex parts of the first arguments to the real and complex parts of the second. More... | |
| template<typename T > | |
| plain_type_t< T > | corr_constrain (const T &x) |
| Return the result of transforming the specified scalar or container of values to have a valid correlation value between -1 and 1 (inclusive). More... | |
| template<typename T_x , typename T_lp > | |
| auto | corr_constrain (const T_x &x, T_lp &lp) |
| Return the result of transforming the specified scalar or container of values to have a valid correlation value between -1 and 1 (inclusive). More... | |
| template<bool Jacobian, typename T_x , typename T_lp > | |
| auto | corr_constrain (const T_x &x, T_lp &lp) |
| Return the result of transforming the specified scalar or container of values to have a valid correlation value between -1 and 1 (inclusive). More... | |
| template<typename T > | |
| T | corr_free (const T &y) |
| Return the unconstrained scalar that when transformed to a valid correlation produces the specified value. More... | |
| template<typename T , require_eigen_col_vector_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | corr_matrix_constrain (const T &x, Eigen::Index k) |
| Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values. More... | |
| template<typename T , require_eigen_col_vector_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | corr_matrix_constrain (const T &x, Eigen::Index k, return_type_t< T > &lp) |
| Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values. More... | |
| template<bool Jacobian, typename T , require_not_std_vector_t< T > * = nullptr> | |
| auto | corr_matrix_constrain (const T &x, Eigen::Index k, return_type_t< T > &lp) |
| Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values. More... | |
| template<bool Jacobian, typename T , require_std_vector_t< T > * = nullptr> | |
| auto | corr_matrix_constrain (const T &y, int K, return_type_t< T > &lp) |
| Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values. More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, 1 > | corr_matrix_free (const T &y) |
| Return the vector of unconstrained partial correlations that define the specified correlation matrix when transformed. More... | |
| template<typename T , require_std_vector_t< T > * = nullptr> | |
| auto | corr_matrix_free (const T &x) |
Overload of corr_matrix_free() to untransform each matrix in a standard vector. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | cos (const Container &x) |
Returns the elementwise cos() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | cos (const Container &x) |
Version of cos() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | cosh (const Container &x) |
Returns the elementwise cosh() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | cosh (const Container &x) |
Version of cosh() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename T_x , typename T_sigma , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x, T_sigma, T_l >, Eigen::Dynamic, Eigen::Dynamic > | cov_exp_quad (const std::vector< T_x > &x, const T_sigma &sigma, const T_l &length_scale) |
| template<typename T_x , typename T_sigma , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x, T_sigma, T_l >, Eigen::Dynamic, Eigen::Dynamic > | cov_exp_quad (const std::vector< T_x > &x, const T_sigma &sigma, const std::vector< T_l > &length_scale) |
| template<typename T_x1 , typename T_x2 , typename T_sigma , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_sigma, T_l >, Eigen::Dynamic, Eigen::Dynamic > | cov_exp_quad (const std::vector< T_x1 > &x1, const std::vector< T_x2 > &x2, const T_sigma &sigma, const T_l &length_scale) |
| template<typename T_x1 , typename T_x2 , typename T_sigma , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_sigma, T_l >, Eigen::Dynamic, Eigen::Dynamic > | cov_exp_quad (const std::vector< T_x1 > &x1, const std::vector< T_x2 > &x2, const T_sigma &sigma, const std::vector< T_l > &length_scale) |
| template<typename T , require_eigen_col_vector_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | cov_matrix_constrain (const T &x, Eigen::Index K) |
| Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2). More... | |
| template<typename T , require_eigen_col_vector_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | cov_matrix_constrain (const T &x, Eigen::Index K, return_type_t< T > &lp) |
| Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2). More... | |
| template<bool Jacobian, typename T , require_not_std_vector_t< T > * = nullptr> | |
| auto | cov_matrix_constrain (const T &x, Eigen::Index K, return_type_t< T > &lp) |
| Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2). More... | |
| template<typename T , require_eigen_vector_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | cov_matrix_constrain_lkj (const T &x, size_t k) |
| Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values. More... | |
| template<typename T , require_eigen_vector_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | cov_matrix_constrain_lkj (const T &x, size_t k, return_type_t< T > &lp) |
| Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values and increment the specified log probability reference with the log absolute Jacobian determinant. More... | |
| template<bool Jacobian, typename T , require_not_std_vector_t< T > * = nullptr> | |
| auto | cov_matrix_constrain_lkj (const T &x, size_t k, return_type_t< T > &lp) |
| Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values. More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, 1 > | cov_matrix_free (const T &y) |
| The covariance matrix derived from the symmetric view of the lower-triangular view of the K by K specified matrix is freed to return a vector of size K + (K choose 2). More... | |
| template<typename T , require_std_vector_t< T > * = nullptr> | |
| auto | cov_matrix_free (const T &x) |
Overload of cov_matrix_free() to untransform each matrix in a standard vector. More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, 1 > | cov_matrix_free_lkj (const T &y) |
| Return the vector of unconstrained partial correlations and deviations that transform to the specified covariance matrix. More... | |
| template<typename T , require_std_vector_t< T > * = nullptr> | |
| auto | cov_matrix_free_lkj (const T &x) |
Overload of cov_matrix_free_lkj() to untransform each matrix in a standard vector. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| auto | crossprod (const EigMat &M) |
| Returns the result of pre-multiplying a matrix by its own transpose. More... | |
| template<typename T > | |
| const std::vector< int > | csr_extract_u (const Eigen::SparseMatrix< T, Eigen::RowMajor > &A) |
| Extract the NZE index for each entry from a sparse matrix. More... | |
| template<typename T , require_eigen_dense_base_t< T > * = nullptr> | |
| const std::vector< int > | csr_extract_u (const T &A) |
| Extract the NZE index for each entry from a sparse matrix. More... | |
| template<typename T > | |
| const std::vector< int > | csr_extract_v (const Eigen::SparseMatrix< T, Eigen::RowMajor > &A) |
| Extract the column indexes for non-zero value from a sparse matrix. More... | |
| template<typename T , require_eigen_dense_base_t< T > * = nullptr> | |
| const std::vector< int > | csr_extract_v (const T &A) |
| Extract the column indexes for non-zero values from a dense matrix by converting to sparse and calling the sparse matrix extractor. More... | |
| template<typename T > | |
| const Eigen::Matrix< T, Eigen::Dynamic, 1 > | csr_extract_w (const Eigen::SparseMatrix< T, Eigen::RowMajor > &A) |
| template<typename T , require_eigen_dense_base_t< T > * = nullptr> | |
| const Eigen::Matrix< scalar_type_t< T >, Eigen::Dynamic, 1 > | csr_extract_w (const T &A) |
| template<typename T1 , typename T2 , require_all_not_rev_matrix_t< T1, T2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< T1, T2 >, Eigen::Dynamic, 1 > | csr_matrix_times_vector (int m, int n, const T1 &w, const std::vector< int > &v, const std::vector< int > &u, const T2 &b) |
| template<typename T > | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | csr_to_dense_matrix (int m, int n, const T &w, const std::vector< int > &v, const std::vector< int > &u) |
| Construct a dense Eigen matrix from the CSR format components. More... | |
| int | csr_u_to_z (const std::vector< int > &u, int i) |
| Return the z vector computed from the specified u vector at the index for the z vector. More... | |
| template<typename T > | |
| std::vector< T > | cumulative_sum (const std::vector< T > &x) |
| Return the cumulative sum of the specified vector. More... | |
| template<typename EigVec , require_eigen_vector_t< EigVec > * = nullptr> | |
| auto | cumulative_sum (const EigVec &m) |
| Return the cumulative sum of the specified vector. More... | |
| template<typename T , require_eigen_vt< std::is_arithmetic, T > * = nullptr> | |
| value_type_t< T > | determinant (const T &m) |
| Returns the determinant of the specified square matrix. More... | |
| template<typename EigVec , require_eigen_vector_t< EigVec > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigVec >, Eigen::Dynamic, Eigen::Dynamic > | diag_matrix (const EigVec &v) |
| Return a square diagonal matrix with the specified vector of coefficients as the diagonal values. More... | |
| template<typename T1 , typename T2 , require_eigen_t< T1 > * = nullptr, require_eigen_vector_t< T2 > * = nullptr, require_all_not_st_var< T1, T2 > * = nullptr> | |
| auto | diag_post_multiply (const T1 &m1, const T2 &m2) |
| Return the product of the matrix and the diagonal matrix formed from the vector or row_vector. More... | |
| template<typename T1 , typename T2 , require_eigen_vector_t< T1 > * = nullptr, require_eigen_t< T2 > * = nullptr, require_all_not_st_var< T1, T2 > * = nullptr> | |
| auto | diag_pre_multiply (const T1 &m1, const T2 &m2) |
| Return the product of the diagonal matrix formed from the vector or row_vector and a matrix. More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| auto | diagonal (const T &m) |
| Return a column vector of the diagonal elements of the specified matrix. More... | |
| double | digamma (double x) |
| Return the derivative of the log gamma function at the specified value. More... | |
| template<typename T , require_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | digamma (const T &x) |
| Vectorized version of digamma(). More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| void | dims (const T &x, std::vector< int > &result) |
| Pushes dimensions of given argument into given result vector. More... | |
| template<typename T , typename Alloc > | |
| void | dims (const std::vector< T, Alloc > &x, std::vector< int > &result) |
| Pushes dimensions of given argument into given result vector. More... | |
| template<typename T > | |
| std::vector< int > | dims (const T &x) |
| Determines dimensions of an argument. More... | |
| template<typename T1 , typename T2 , require_all_stan_scalar_t< T1, T2 > * = nullptr> | |
| return_type_t< T1, T2 > | distance (const T1 &x1, const T2 &x2) |
| Returns the distance between two scalars. More... | |
| template<typename Scal1 , typename Scal2 , require_all_stan_scalar_t< Scal1, Scal2 > * = nullptr> | |
| return_type_t< Scal1, Scal2 > | divide (const Scal1 &x, const Scal2 &y) |
| Return the division of the first scalar by the second scalar. More... | |
| int | divide (int x, int y) |
| template<typename T1 , typename T2 , require_any_eigen_t< T1, T2 > * = nullptr, require_all_not_st_var< T1, T2 > * = nullptr> | |
| auto | divide (const T1 &m, const T2 &c) |
| Return matrix divided by scalar. More... | |
| template<typename T_x , typename T_v > | |
| std::vector< Eigen::Matrix< return_type_t< T_x, T_v, double >, Eigen::Dynamic, 1 > > | divide_columns (const std::vector< Eigen::Matrix< T_x, Eigen::Dynamic, 1 >> &x, const std::vector< T_v > &vec) |
| Takes Stan data type vector[n] x[D] and divides column vector in x element-wise by the values in vec. More... | |
| double | dot (const std::vector< double > &x, const std::vector< double > &y) |
| template<typename Vec1 , typename Vec2 , require_all_eigen_vector_t< Vec1, Vec2 > * = nullptr, require_not_var_t< return_type_t< Vec1, Vec2 >> * = nullptr> | |
| auto | dot_product (const Vec1 &v1, const Vec2 &v2) |
| Returns the dot product of the specified vectors. More... | |
| template<typename Scalar1 , typename Scalar2 , require_all_stan_scalar_t< Scalar1, Scalar2 > * = nullptr, require_all_not_var_t< Scalar1, Scalar2 > * = nullptr> | |
| auto | dot_product (const Scalar1 *v1, const Scalar2 *v2, size_t length) |
| Returns the dot product of the specified arrays. More... | |
| template<typename Scalar1 , typename Scalar2 , typename Alloc1 , typename Alloc2 , require_all_stan_scalar_t< Scalar1, Scalar2 > * = nullptr> | |
| return_type_t< Scalar1, Scalar2 > | dot_product (const std::vector< Scalar1, Alloc1 > &v1, const std::vector< Scalar2, Alloc2 > &v2) |
| Returns the dot product of the specified arrays. More... | |
| double | dot_self (const std::vector< double > &x) |
| template<typename T , require_eigen_t< T > * = nullptr, require_not_eigen_vt< is_var, T > * = nullptr> | |
| value_type_t< T > | dot_self (const T &v) |
| Returns squared norm of a vector or matrix. More... | |
| template<typename T_a , typename T_b , require_any_eigen_t< T_a, T_b > * = nullptr, require_any_st_autodiff< T_a, T_b > * = nullptr, require_not_st_same< T_a, T_b > * = nullptr> | |
| auto | operator< (const T_a &a, const T_b &b) |
| template<typename T_a , typename T_b , require_any_eigen_t< T_a, T_b > * = nullptr, require_any_st_autodiff< T_a, T_b > * = nullptr, require_not_st_same< T_a, T_b > * = nullptr> | |
| auto | operator<= (const T_a &a, const T_b &b) |
| template<typename T_a , typename T_b , require_any_eigen_t< T_a, T_b > * = nullptr, require_any_st_autodiff< T_a, T_b > * = nullptr, require_not_st_same< T_a, T_b > * = nullptr> | |
| auto | operator> (const T_a &a, const T_b &b) |
| template<typename T_a , typename T_b , require_any_eigen_t< T_a, T_b > * = nullptr, require_any_st_autodiff< T_a, T_b > * = nullptr, require_not_st_same< T_a, T_b > * = nullptr> | |
| auto | operator>= (const T_a &a, const T_b &b) |
| template<typename T_a , typename T_b , require_any_eigen_t< T_a, T_b > * = nullptr, require_any_st_autodiff< T_a, T_b > * = nullptr, require_not_st_same< T_a, T_b > * = nullptr> | |
| auto | operator== (const T_a &a, const T_b &b) |
| template<typename T_a , typename T_b , require_any_eigen_t< T_a, T_b > * = nullptr, require_any_st_autodiff< T_a, T_b > * = nullptr, require_not_st_same< T_a, T_b > * = nullptr> | |
| auto | operator!= (const T_a &a, const T_b &b) |
| template<typename T > | |
| Eigen::Matrix< std::complex< T >,-1, 1 > | eigenvalues (const Eigen::Matrix< T,-1,-1 > &m) |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr, require_not_st_var< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, 1 > | eigenvalues_sym (const EigMat &m) |
| Return the eigenvalues of the specified symmetric matrix in descending order of magnitude. More... | |
| template<typename T > | |
| Eigen::Matrix< std::complex< T >,-1,-1 > | eigenvectors (const Eigen::Matrix< T,-1,-1 > &m) |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr, require_not_st_var< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | eigenvectors_sym (const EigMat &m) |
| template<typename Mat1 , typename Mat2 , require_all_eigen_t< Mat1, Mat2 > * = nullptr, require_all_not_st_var< Mat1, Mat2 > * = nullptr> | |
| auto | elt_divide (const Mat1 &m1, const Mat2 &m2) |
| Return the elementwise division of the specified matrices. More... | |
| template<typename Mat , typename Scal , require_matrix_t< Mat > * = nullptr, require_stan_scalar_t< Scal > * = nullptr> | |
| auto | elt_divide (const Mat &m, Scal s) |
| Return the elementwise division of the specified matrix by the specified scalar. More... | |
| template<typename Scal , typename Mat , require_stan_scalar_t< Scal > * = nullptr, require_eigen_t< Mat > * = nullptr> | |
| auto | elt_divide (Scal s, const Mat &m) |
| Return the elementwise division of the specified scalar by the specified matrix. More... | |
| template<typename Scal1 , typename Scal2 , require_all_stan_scalar_t< Scal1, Scal2 > * = nullptr> | |
| auto | elt_divide (Scal1 s1, Scal2 s2) |
| template<typename Mat1 , typename Mat2 , require_all_eigen_t< Mat1, Mat2 > * = nullptr, require_all_not_st_var< Mat1, Mat2 > * = nullptr> | |
| auto | elt_multiply (const Mat1 &m1, const Mat2 &m2) |
| Return the elementwise multiplication of the specified matrices. More... | |
| template<typename Scalar1 , typename Scalar2 , require_all_stan_scalar_t< Scalar1, Scalar2 > * = nullptr> | |
| auto | elt_multiply (const Scalar1 &a, const Scalar2 &b) |
| Return the elementwise multiplication of the specified scalars. More... | |
| template<typename T1 , typename T2 , require_any_matrix_t< T1, T2 > * = nullptr, require_any_stan_scalar_t< T1, T2 > * = nullptr> | |
| auto | elt_multiply (const T1 &A, const T2 &B) |
| Return specified matrix multiplied by specified scalar. More... | |
| template<typename T , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | erf (const T &x) |
Returns the elementwise erf() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename T , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | erfc (const T &x) |
Returns the elementwise erfc() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename T , require_same_t< std::decay_t< T >, plain_type_t< T >> * = nullptr> | |
| T | eval (T &&arg) |
| Inputs which have a plain_type equal to the own time are forwarded unmodified (for Eigen expressions these types are different) More... | |
| template<typename T , require_not_same_t< std::decay_t< T >, plain_type_t< T >> * = nullptr> | |
| decltype(auto) | eval (const T &arg) |
| Inputs which have a plain_type different from their own type are Eval'd (this catches Eigen expressions) More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr> | |
| auto | exp (const Container &x) |
Return the elementwise exp() of the specified argument, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | exp (const Container &x) |
Version of exp() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename T , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | exp2 (const T &x) |
Return the elementwise exp2() of the specified argument, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename T , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | expm1 (const T &x) |
Return the elementwise expm1() of the specified argument, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename T > | |
| T | F32 (const T &a1, const T &a2, const T &a3, const T &b1, const T &b2, const T &z, double precision=1e-6, int max_steps=1e5) |
| Hypergeometric function (3F2). More... | |
| template<typename T , require_arithmetic_t< T > * = nullptr> | |
| auto | fabs (T x) |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr, require_not_stan_scalar_t< Container > * = nullptr> | |
| auto | fabs (const Container &x) |
Returns the elementwise fabs() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | fabs (const Container &x) |
Version of fabs() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename T_Sigma , typename T_CPCs , typename T_sds , require_eigen_t< T_Sigma > * = nullptr, require_all_eigen_vector_t< T_CPCs, T_sds > * = nullptr, require_all_vt_same< T_Sigma, T_CPCs, T_sds > * = nullptr> | |
| bool | factor_cov_matrix (const T_Sigma &Sigma, T_CPCs &&CPCs, T_sds &&sds) |
| This function is intended to make starting values, given a covariance matrix Sigma. More... | |
| template<typename T_U , typename T_CPCs , require_eigen_t< T_U > * = nullptr, require_eigen_vector_t< T_CPCs > * = nullptr, require_vt_same< T_U, T_CPCs > * = nullptr> | |
| void | factor_U (const T_U &U, T_CPCs &&CPCs) |
| This function is intended to make starting values, given a unit upper-triangular matrix U such that U'DU is a correlation matrix. More... | |
| template<typename T , require_arithmetic_t< T > * = nullptr> | |
| return_type_t< T > | falling_factorial (const T &x, int n) |
| Return the falling factorial function evaluated at the inputs. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr, require_all_not_var_matrix_t< T1, T2 > * = nullptr> | |
| auto | falling_factorial (const T1 &a, const T2 &b) |
| Enables the vectorised application of the falling factorial function, when the first and/or second arguments are containers. More... | |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| double | fdim (T1 x, T2 y) |
| Return the positive difference of the specified values (C++11). More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | fdim (const T1 &a, const T2 &b) |
| Enables the vectorised application of the fdim function, when the first and/or second arguments are containers. More... | |
| template<typename EigMat , typename S , require_eigen_t< EigMat > * = nullptr, require_stan_scalar_t< S > * = nullptr> | |
| void | fill (EigMat &x, const S &y) |
| Fill the specified container with the specified value. More... | |
| template<typename T , typename S , require_t< std::is_assignable< std::decay_t< T > &, std::decay_t< S >>> * = nullptr> | |
| void | fill (T &x, S &&y) |
| Fill the specified container with the specified value. More... | |
| template<typename Vec , typename S , require_std_vector_t< Vec > * = nullptr> | |
| void | fill (Vec &x, S &&y) |
| Fill the specified container with the specified value. More... | |
| double | finite_diff_stepsize (double u) |
| Return the stepsize for finite difference evaluations at the specified scalar. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr> | |
| auto | floor (const Container &x) |
Returns the elementwise floor() of the input, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr> | |
| auto | floor (const Container &x) |
Version of floor() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename T1 , typename T2 , typename T3 , require_all_arithmetic_t< T1, T2, T3 > * = nullptr> | |
| double | fma (T1 x, T2 y, T3 z) |
| Return the product of the first two arguments plus the third argument. More... | |
| template<typename T1 , typename T2 , typename T3 , require_any_matrix_t< T1, T2, T3 > * = nullptr, require_not_var_t< return_type_t< T1, T2, T3 >> * = nullptr> | |
| auto | fma (T1 &&x, T2 &&y, T3 &&z) |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| double | fmax (T1 x, T2 y) |
| Return the greater of the two specified arguments. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | fmax (const T1 &a, const T2 &b) |
| Enables the vectorised application of the fmax function, when the first and/or second arguments are containers. More... | |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| double | fmin (T1 x, T2 y) |
| Return the lesser of the two specified arguments. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | fmin (const T1 &a, const T2 &b) |
| Enables the vectorised application of the fmin function, when the first and/or second arguments are containers. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | fmod (const T1 &a, const T2 &b) |
| Enables the vectorised application of the fmod function, when the first and/or second arguments are containers. More... | |
| double | gamma_p (double z, double a) |
| Return the value of the normalized, lower-incomplete gamma function applied to the specified argument. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | gamma_p (const T1 &a, const T2 &b) |
| Enables the vectorised application of the gamma_p function, when the first and/or second arguments are containers. More... | |
| double | gamma_q (double x, double a) |
\[ \mbox{gamma\_q}(a, z) = \begin{cases} \textrm{error} & \mbox{if } a\leq 0 \textrm{ or } z < 0\\ Q(a, z) & \mbox{if } a > 0, z \geq 0 \\[6pt] \textrm{NaN} & \mbox{if } a = \textrm{NaN or } z = \textrm{NaN} \end{cases} \] More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | gamma_q (const T1 &a, const T2 &b) |
| Enables the vectorised application of the gamma_q function, when the first and/or second arguments are containers. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr, require_not_vt_var< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, EigMat::ColsAtCompileTime, EigMat::RowsAtCompileTime > | generalized_inverse (const EigMat &G) |
| Returns the Moore-Penrose generalized inverse of the specified matrix. More... | |
| template<typename T > | |
| const T & | get_base1 (const std::vector< T > &x, size_t i, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one index. More... | |
| template<typename T > | |
| const T & | get_base1 (const std::vector< std::vector< T > > &x, size_t i1, size_t i2, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| const T & | get_base1 (const std::vector< std::vector< std::vector< T > > > &x, size_t i1, size_t i2, size_t i3, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| const T & | get_base1 (const std::vector< std::vector< std::vector< std::vector< T > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| const T & | get_base1 (const std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| const T & | get_base1 (const std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| const T & | get_base1 (const std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| const T & | get_base1 (const std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7, size_t i8, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr, require_not_eigen_vector_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, 1, Eigen::Dynamic > | get_base1 (const EigMat &x, size_t m, const char *error_msg, size_t idx) |
| Return a copy of the row of the specified matrix at the specified base-one row index. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| const value_type_t< EigMat > & | get_base1 (const EigMat &x, size_t m, size_t n, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified matrix at the specified base-one row and column indexes. More... | |
| template<typename EigVec , require_eigen_vector_t< EigVec > * = nullptr> | |
| const value_type_t< EigVec > & | get_base1 (const EigVec &x, size_t m, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified Eigen vector at the specified base-one index. More... | |
| template<typename T > | |
| T & | get_base1_lhs (std::vector< T > &x, size_t i, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one index. More... | |
| template<typename T > | |
| T & | get_base1_lhs (std::vector< std::vector< T > > &x, size_t i1, size_t i2, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| T & | get_base1_lhs (std::vector< std::vector< std::vector< T > > > &x, size_t i1, size_t i2, size_t i3, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| T & | get_base1_lhs (std::vector< std::vector< std::vector< std::vector< T > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| T & | get_base1_lhs (std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| T & | get_base1_lhs (std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| T & | get_base1_lhs (std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| T & | get_base1_lhs (std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7, size_t i8, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified vector at the specified base-one indexes. More... | |
| template<typename T > | |
| Eigen::Block< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > > | get_base1_lhs (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &x, size_t m, const char *error_msg, size_t idx) |
| Return a copy of the row of the specified vector at the specified base-one row index. More... | |
| template<typename T > | |
| T & | get_base1_lhs (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &x, size_t m, size_t n, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified matrix at the specified base-one row and column indexes. More... | |
| template<typename T > | |
| T & | get_base1_lhs (Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, size_t m, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified column vector at the specified base-one index. More... | |
| template<typename T > | |
| T & | get_base1_lhs (Eigen::Matrix< T, 1, Eigen::Dynamic > &x, size_t n, const char *error_msg, size_t idx) |
| Return a reference to the value of the specified row vector at the specified base-one index. More... | |
| template<typename T > | |
| T | get_imag (const std::complex< T > &z) |
| Return the imaginary component of the complex argument. More... | |
| template<typename T_lp , typename T_lp_accum > | |
| return_type_t< T_lp, T_lp_accum > | get_lp (const T_lp &lp, const accumulator< T_lp_accum > &lp_accum) |
| template<typename T > | |
| T | get_real (const std::complex< T > &z) |
| Return the real component of the complex argument. More... | |
| template<typename T_x , typename T_sigma > | |
| Eigen::Matrix< return_type_t< T_x, T_sigma >, Eigen::Dynamic, Eigen::Dynamic > | gp_dot_prod_cov (const std::vector< Eigen::Matrix< T_x, Eigen::Dynamic, 1 >> &x, const T_sigma &sigma) |
| Returns a dot product covariance matrix. More... | |
| template<typename T_x , typename T_sigma > | |
| Eigen::Matrix< return_type_t< T_x, T_sigma >, Eigen::Dynamic, Eigen::Dynamic > | gp_dot_prod_cov (const std::vector< T_x > &x, const T_sigma &sigma) |
| Returns a dot product covariance matrix. More... | |
| template<typename T_x1 , typename T_x2 , typename T_sigma > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_sigma >, Eigen::Dynamic, Eigen::Dynamic > | gp_dot_prod_cov (const std::vector< Eigen::Matrix< T_x1, Eigen::Dynamic, 1 >> &x1, const std::vector< Eigen::Matrix< T_x2, Eigen::Dynamic, 1 >> &x2, const T_sigma &sigma) |
| Returns a dot product covariance matrix of differing x's. More... | |
| template<typename T_x1 , typename T_x2 , typename T_sigma > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_sigma >, Eigen::Dynamic, Eigen::Dynamic > | gp_dot_prod_cov (const std::vector< T_x1 > &x1, const std::vector< T_x2 > &x2, const T_sigma &sigma) |
| Returns a dot product covariance matrix of differing x's. More... | |
| template<typename T_x , typename T_sigma , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x, T_sigma, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_exp_quad_cov (const std::vector< T_x > &x, const T_sigma &sigma, const T_l &length_scale) |
| Returns a squared exponential kernel. More... | |
| template<typename T_x , typename T_sigma , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x, T_sigma, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_exp_quad_cov (const std::vector< Eigen::Matrix< T_x,-1, 1 >> &x, const T_sigma &sigma, const std::vector< T_l > &length_scale) |
| Returns a squared exponential kernel. More... | |
| template<typename T_x1 , typename T_x2 , typename T_sigma , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_sigma, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_exp_quad_cov (const std::vector< T_x1 > &x1, const std::vector< T_x2 > &x2, const T_sigma &sigma, const T_l &length_scale) |
| Returns a squared exponential kernel. More... | |
| template<typename T_x1 , typename T_x2 , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_exp_quad_cov (const std::vector< Eigen::Matrix< T_x1,-1, 1 >> &x1, const std::vector< Eigen::Matrix< T_x2,-1, 1 >> &x2, const T_s &sigma, const std::vector< T_l > &length_scale) |
| Returns a squared exponential kernel. More... | |
| template<typename T_x , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_exponential_cov (const std::vector< T_x > &x, const T_s &sigma, const T_l &length_scale) |
| Returns a Matern exponential covariance Matrix. More... | |
| template<typename T_x , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_exponential_cov (const std::vector< Eigen::Matrix< T_x,-1, 1 >> &x, const T_s &sigma, const std::vector< T_l > &length_scale) |
| Returns a Matern exponential covariance matrix. More... | |
| template<typename T_x1 , typename T_x2 , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_exponential_cov (const std::vector< T_x1 > &x1, const std::vector< T_x2 > &x2, const T_s &sigma, const T_l &length_scale) |
| Returns a Matern exponential cross covariance matrix. More... | |
| template<typename T_x1 , typename T_x2 , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_exponential_cov (const std::vector< Eigen::Matrix< T_x1,-1, 1 >> &x1, const std::vector< Eigen::Matrix< T_x2,-1, 1 >> &x2, const T_s &sigma, const std::vector< T_l > &length_scale) |
| Returns a Matern exponential cross covariance matrix. More... | |
| template<typename T_x , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_matern32_cov (const std::vector< T_x > &x, const T_s &sigma, const T_l &length_scale) |
| Returns a Matern 3/2 covariance matrix. More... | |
| template<typename T_x , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_matern32_cov (const std::vector< Eigen::Matrix< T_x,-1, 1 >> &x, const T_s &sigma, const std::vector< T_l > &length_scale) |
| Returns a Matern 3/2 covariance matrix. More... | |
| template<typename T_x1 , typename T_x2 , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_matern32_cov (const std::vector< T_x1 > &x1, const std::vector< T_x2 > &x2, const T_s &sigma, const T_l &length_scale) |
| Returns a Matern 3/2 cross covariance matrix. More... | |
| template<typename T_x1 , typename T_x2 , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_matern32_cov (const std::vector< Eigen::Matrix< T_x1,-1, 1 >> &x1, const std::vector< Eigen::Matrix< T_x2,-1, 1 >> &x2, const T_s &sigma, const std::vector< T_l > &length_scale) |
| Returns a Matern 3/2 cross covariance matrix. More... | |
| template<typename T_x , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_matern52_cov (const std::vector< T_x > &x, const T_s &sigma, const T_l &length_scale) |
| Returns a Matern 5/2 covariance matrix with one input vector. More... | |
| template<typename T_x , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_matern52_cov (const std::vector< Eigen::Matrix< T_x, Eigen::Dynamic, 1 >> &x, const T_s &sigma, const std::vector< T_l > &length_scale) |
| Returns a Matern 5/2 covariance matrix with one input vector with automatic relevance determination (ARD). More... | |
| template<typename T_x1 , typename T_x2 , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_matern52_cov (const std::vector< T_x1 > &x1, const std::vector< T_x2 > &x2, const T_s &sigma, const T_l &length_scale) |
| Returns a Matern 5/2 covariance matrix with two different input vectors. More... | |
| template<typename T_x1 , typename T_x2 , typename T_s , typename T_l > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > | gp_matern52_cov (const std::vector< Eigen::Matrix< T_x1, Eigen::Dynamic, 1 >> &x1, const std::vector< Eigen::Matrix< T_x2, Eigen::Dynamic, 1 >> &x2, const T_s &sigma, const std::vector< T_l > &length_scale) |
| Returns a Matern 5/2 covariance matrix with two input vectors with automatic relevance determination (ARD). More... | |
| template<typename T_x , typename T_sigma , typename T_l , typename T_p > | |
| Eigen::Matrix< return_type_t< T_x, T_sigma, T_l, T_p >, Eigen::Dynamic, Eigen::Dynamic > | gp_periodic_cov (const std::vector< T_x > &x, const T_sigma &sigma, const T_l &l, const T_p &p) |
| Returns a periodic covariance matrix \( \mathbf{K} \) using the input \( \mathbf{X} \). More... | |
| template<typename T_x1 , typename T_x2 , typename T_sigma , typename T_l , typename T_p > | |
| Eigen::Matrix< return_type_t< T_x1, T_x2, T_sigma, T_l, T_p >, Eigen::Dynamic, Eigen::Dynamic > | gp_periodic_cov (const std::vector< T_x1 > &x1, const std::vector< T_x2 > &x2, const T_sigma &sigma, const T_l &l, const T_p &p) |
| Returns a periodic covariance matrix \( \mathbf{K} \) using inputs \( \mathbf{X}_1 \) and \( \mathbf{X}_2 \). More... | |
| template<typename T > | |
| void | grad_2F1 (T &g_a1, T &g_b1, const T &a1, const T &a2, const T &b1, const T &z, double precision=1e-14, int max_steps=1e6) |
| Gradients of the hypergeometric function, 2F1. More... | |
| template<typename T > | |
| void | grad_F32 (T *g, const T &a1, const T &a2, const T &a3, const T &b1, const T &b2, const T &z, const T &precision=1e-6, int max_steps=1e5) |
| Gradients of the hypergeometric function, 3F2. More... | |
| void | grad_inc_beta (double &g1, double &g2, double a, double b, double z) |
| template<typename T > | |
| void | grad_reg_inc_beta (T &g1, T &g2, const T &a, const T &b, const T &z, const T &digammaA, const T &digammaB, const T &digammaSum, const T &betaAB) |
| Computes the gradients of the regularized incomplete beta function. More... | |
| template<typename T1 , typename T2 > | |
| return_type_t< T1, T2 > | grad_reg_inc_gamma (T1 a, T2 z, T1 g, T1 dig, double precision=1e-6, int max_steps=1e5) |
| Gradient of the regularized incomplete gamma functions igamma(a, z) More... | |
| template<typename T1 , typename T2 > | |
| return_type_t< T1, T2 > | grad_reg_lower_inc_gamma (const T1 &a, const T2 &z, double precision=1e-10, int max_steps=1e5) |
| Computes the gradient of the lower regularized incomplete gamma function. More... | |
| template<typename T , require_vector_t< T > * = nullptr> | |
| auto | head (const T &v, size_t n) |
| Return the specified number of elements as a vector or row vector (same as input) from the front of the specified vector or row vector. More... | |
| template<typename T > | |
| std::vector< T > | head (const std::vector< T > &sv, size_t n) |
| Return the specified number of elements as a standard vector from the front of the specified standard vector. More... | |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| double | hypot (T1 x, T2 y) |
| Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11). More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr> | |
| auto | hypot (const T1 &a, const T2 &b) |
| Enables the vectorised application of the hypot function, when the first and/or second arguments are containers. More... | |
| template<typename T > | |
| std::complex< T > | i_times (const std::complex< T > &z) |
Return the specified complex number multiplied by i. More... | |
| template<typename T > | |
| std::complex< T > | neg_i_times (const std::complex< T > &z) |
Return the specified complex number multiplied by -i. More... | |
| template<typename V > | |
| std::complex< V > | complex_negate (const std::complex< V > &z) |
| Return the complex negation of the specified complex argument. More... | |
| template<bool Jacobian = false, typename T , typename... Types, require_all_not_var_matrix_t< T, Types... > * = nullptr> | |
| auto | identity_constrain (T &&x, Types &&...) |
| Returns the result of applying the identity constraint transform to the input. More... | |
| template<typename T , typename... Types, require_all_not_var_matrix_t< T, Types... > * = nullptr> | |
| auto | identity_free (T &&x, Types &&...) |
| Returns the result of applying the inverse of the identity constraint transform to the input. More... | |
| template<typename T_true , typename T_false > | |
| return_type_t< T_true, T_false > | if_else (const bool c, const T_true y_true, const T_false y_false) |
| Return the second argument if the first argument is true and otherwise return the second argument. More... | |
| template<typename T , require_autodiff_t< T > > | |
| T | imag (const std::complex< T > &z) |
| Return the imaginary component of the complex argument. More... | |
| double | inc_beta (double a, double b, double x) |
| The normalized incomplete beta function of a, b, with outcome x. More... | |
| template<typename T > | |
| T | inc_beta_dda (T a, T b, T z, T digamma_a, T digamma_ab) |
| Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to a. More... | |
| template<typename T > | |
| T | inc_beta_ddb (T a, T b, T z, T digamma_b, T digamma_ab) |
| Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to b. More... | |
| template<typename T > | |
| T | inc_beta_ddz (T a, T b, T z) |
| Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to z. More... | |
| template<> | |
| double | inc_beta_ddz (double a, double b, double z) |
| template<typename T , typename V , require_all_stan_scalar_t< T, V > * = nullptr, require_convertible_t< V, T > * = nullptr> | |
| void | initialize (T &x, V v) |
| template<typename T , int R, int C, typename V > | |
| void | initialize (Eigen::Matrix< T, R, C > &x, const V &v) |
| template<typename T , typename V > | |
| void | initialize (std::vector< T > &x, const V &v) |
| template<typename EigMat , typename S , require_eigen_t< EigMat > * = nullptr, require_stan_scalar_t< S > * = nullptr> | |
| void | initialize_fill (EigMat &x, const S &y) |
| Fill the specified container with the specified value. More... | |
| template<typename T , typename S , require_t< std::is_assignable< std::decay_t< T > &, std::decay_t< S >>> * = nullptr> | |
| void | initialize_fill (T &x, S &&y) |
| Fill the specified container with the specified value. More... | |
| template<typename Vec , typename S , require_std_vector_t< Vec > * = nullptr> | |
| void | initialize_fill (Vec &x, S &&y) |
| Fill the specified container with the specified value. More... | |
| template<typename T > | |
| int | int_step (const T &y) |
| The integer step, or Heaviside, function. More... | |
| template<typename T , require_not_container_st< std::is_arithmetic, T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | inv (const T &x) |
| Return the elementwise 1.0 / x of the specified argument, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | inv (const Container &x) |
Version of inv() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| double | inv_cloglog (double x) |
| The inverse complementary log-log function. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | inv_cloglog (const Container &x) |
| Vectorized version of inv_cloglog(). More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | inv_cloglog (const Container &x) |
| Version of inv_cloglog() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| double | inv_logit (double a) |
| Returns the inverse logit function applied to the argument. More... | |
| template<typename T , require_not_var_matrix_t< T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | inv_logit (const T &x) |
| Vectorized version of inv_logit(). More... | |
| double | inv_Phi (double p) |
| Return the value of the inverse standard normal cumulative distribution function at the specified argument. More... | |
| template<typename T , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | inv_Phi (const T &x) |
| Vectorized version of inv_Phi(). More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| auto | inv_sqrt (T x) |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_not_stan_scalar_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | inv_sqrt (const Container &x) |
Return the elementwise 1 / sqrt(x)} of the specified argument, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_not_var_matrix_t< Container > * = nullptr, require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | inv_sqrt (const Container &x) |
Version of inv_sqrt() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | inv_square (const Container &x) |
Returns 1 / square(x). More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | inv_square (const Container &x) |
| Version of inv_square() that accepts Eigen Matrix/Array objects or expressions. More... | |
| template<typename Vector , require_vector_t< Vector > * = nullptr> | |
| void | inverse_softmax (const Vector &simplex, Vector &y) |
| Writes the inverse softmax of the simplex argument into the second argument. More... | |
| template<typename EigMat > | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | inverse_spd (const EigMat &m) |
| Returns the inverse of the specified symmetric, pos/neg-definite matrix. More... | |
| template<typename T > | |
| bool | is_any_nan (const T &x) |
| Returns true if the input is NaN and false otherwise. More... | |
| template<typename T , typename... Ts> | |
| bool | is_any_nan (const T &x, const Ts &...xs) |
Returns true if any input is NaN and false otherwise. More... | |
| bool | is_inf (double x) |
| Returns true if the input is infinite and false otherwise. More... | |
| template<typename T > | |
| bool | is_integer (T x) |
| Returns true if the input is an integer and false otherwise. More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| bool | is_nan (T x) |
| Returns true if the input is NaN and false otherwise. More... | |
| template<typename T , typename = require_eigen_t<T>> | |
| bool | is_nan (const T &x) |
| template<typename T > | |
| bool | is_nonpositive_integer (T x) |
| Returns true if the input is a nonpositive integer and false otherwise. More... | |
| template<typename T > | |
| bool | is_uninitialized (T x) |
Returns true if the specified variable is uninitialized. More... | |
| template<typename ADType , require_autodiff_t< ADType > * = nullptr> | |
| bool | isfinite (ADType &&v) |
| Return true if specified argument is finite (not infinite and not not-a-number). More... | |
| template<typename T , typename = require_autodiff_t<T>> | |
| bool | isinf (const T &v) |
| Return true if specified argument is infinite (positive or negative). More... | |
| template<typename T , typename = require_autodiff_t<T>> | |
| bool | isnan (const T &x) |
| Return true if specified argument is not-a-number. More... | |
| template<typename ADType , require_autodiff_t< ADType > * = nullptr> | |
| bool | isnormal (ADType &&v) |
| Return true if specified argument is normal. More... | |
| template<typename T , require_arithmetic_t< T > * = nullptr> | |
| double | lambert_w0 (const T &x) |
| Compute the Lambert W function on W0 branch for a value x. More... | |
| template<typename T , require_arithmetic_t< T > * = nullptr> | |
| double | lambert_wm1 (const T &x) |
| Compute the Lambert W function on W-1 branch for a value x. More... | |
| template<typename T , require_not_stan_scalar_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | lambert_w0 (const T &x) |
| Vectorized version of lambert_w0(). More... | |
| template<typename T , require_not_stan_scalar_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | lambert_wm1 (const T &x) |
| Vectorized version of lambert_wm1(). More... | |
| template<typename T , typename L , require_all_stan_scalar_t< T, L > * = nullptr, require_all_not_st_var< T, L > * = nullptr> | |
| auto | lb_constrain (const T &x, const L &lb) |
| Return the lower-bounded value for the specified unconstrained input and specified lower bound. More... | |
| template<typename T , typename L , require_eigen_t< T > * = nullptr, require_stan_scalar_t< L > * = nullptr, require_all_not_st_var< T, L > * = nullptr> | |
| auto | lb_constrain (T &&x, L &&lb) |
Specialization of lb_constrain to apply a scalar lower bound elementwise to each input. More... | |
| template<typename T , typename L , require_eigen_t< T > * = nullptr, require_stan_scalar_t< L > * = nullptr, require_all_not_st_var< T, L > * = nullptr> | |
| auto | lb_constrain (const T &x, const L &lb, return_type_t< T, L > &lp) |
Specialization of lb_constrain to apply a scalar lower bound elementwise to each input. More... | |
| template<typename T , typename L , require_not_std_vector_t< L > * = nullptr> | |
| auto | lb_constrain (const std::vector< T > &x, const L &lb) |
Specialization of lb_constrain to apply a container of lower bounds elementwise to each input element. More... | |
| template<typename T , typename L , require_not_std_vector_t< L > * = nullptr> | |
| auto | lb_constrain (const std::vector< T > &x, const L &lb, return_type_t< T, L > &lp) |
Specialization of lb_constrain to apply a container of lower bounds elementwise to each input element. More... | |
| template<typename T , typename L > | |
| auto | lb_constrain (const std::vector< T > &x, const std::vector< L > &lb) |
Specialization of lb_constrain to apply a container of lower bounds elementwise to each input element. More... | |
| template<typename T , typename L > | |
| auto | lb_constrain (const std::vector< T > &x, const std::vector< L > &lb, return_type_t< T, L > &lp) |
Specialization of lb_constrain to apply a container of lower bounds elementwise to each input element. More... | |
| template<bool Jacobian, typename T , typename L > | |
| auto | lb_constrain (const T &x, const L &lb, return_type_t< T, L > &lp) |
Specialization of lb_constrain to apply a container of lower bounds elementwise to each input element. More... | |
| template<typename T , typename L , require_not_std_vector_t< T > * = nullptr, require_stan_scalar_t< L > * = nullptr> | |
| auto | lb_free (T &&y, L &&lb) |
| Return the unconstrained value that produces the specified lower-bound constrained value. More... | |
| template<typename T , typename L , require_all_eigen_t< T, L > * = nullptr> | |
| auto | lb_free (T &&y, L &&lb) |
| Return the free matrix that corresponds to the specified lower-bounded matrix with respect to the specified lower bound. More... | |
| template<typename T , typename L , require_not_std_vector_t< L > * = nullptr> | |
| auto | lb_free (const std::vector< T > y, const L &lb) |
| Return the free variable that corresponds to the specified lower-bounded variable with respect to the specified lower bound. More... | |
| template<typename T , typename L > | |
| auto | lb_free (const std::vector< T > y, const std::vector< L > &lb) |
| Return the free variable that corresponds to the specified lower-bounded variable with respect to the specified lower bound. More... | |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| return_type_t< T1, T2 > | lbeta (const T1 a, const T2 b) |
| Return the log of the beta function applied to the specified arguments. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | lbeta (const T1 &a, const T2 &b) |
| Enables the vectorised application of the lbeta function, when the first and/or second arguments are containers. More... | |
| template<typename T1 , require_arithmetic_t< T1 > * = nullptr> | |
| double | ldexp (T1 a, int b) |
| Returns the product of a (the significand) and 2 to power b (the exponent). More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T1, T2 > * = nullptr> | |
| auto | ldexp (const T1 &a, const T2 &b) |
| Enables the vectorised application of the ldexp function, when the first and/or second arguments are containers. More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| auto | make_ldlt_factor (const T &A) |
Make an LDLT_factor with matrix type plain_type_t<T> More... | |
| double | lgamma (double x) |
| Return the natural logarithm of the gamma function applied to the specified argument. More... | |
| double | lgamma (int x) |
| Return the natural logarithm of the gamma function applied to the specified argument. More... | |
| template<typename T , require_not_var_matrix_t< T > * = nullptr, require_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | lgamma (const T &x) |
| Vectorized version of lgamma(). More... | |
| template<typename T > | |
| return_type_t< T > | lgamma_stirling (const T x) |
| Return the Stirling approximation to the lgamma function. More... | |
| template<typename T > | |
| return_type_t< T > | lgamma_stirling_diff (const T x) |
| Return the difference between log of the gamma function and its Stirling approximation. More... | |
| std::vector< int > | linspaced_array (int K, double low, double high) |
| Return an array of linearly spaced elements. More... | |
| std::vector< int > | linspaced_int_array (int K, int low, int high) |
| Return an array of linearly spaced integers. More... | |
| auto | linspaced_row_vector (int K, double low, double high) |
| Return a row vector of linearly spaced elements. More... | |
| auto | linspaced_vector (int K, double low, double high) |
| Return a vector of linearly spaced elements. More... | |
| template<typename T , require_arithmetic_t< T > * = nullptr> | |
| return_type_t< T > | lmgamma (int k, T x) |
| Return the natural logarithm of the multivariate gamma function with the specified dimensions and argument. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | lmgamma (const T1 &a, const T2 &b) |
| Enables the vectorised application of the natural log of the multivariate gamma function, when the first and/or second arguments are containers. More... | |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| return_type_t< T1, T2 > | lmultiply (const T1 a, const T2 b) |
| Return the first argument times the log of the second argument. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr, require_all_not_var_matrix_t< T1, T2 > * = nullptr> | |
| auto | lmultiply (const T1 &a, const T2 &b) |
Return the result of applying lmultiply to the arguments elementwise, with broadcasting if one of the arguments is a scalar. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | log (const Container &x) |
| Return the elementwise natural log of the specified argument, which may be a scalar or any Stan container of numeric scalars. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | log (const Container &x) |
Version of log() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename Container , require_not_var_matrix_t< Container > * = nullptr, require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | log10 (const Container &x) |
| Vectorized version of log10(). More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | log10 (const Container &x) |
| Version of log10() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| double | log1m (double x) |
| Return the natural logarithm of one minus the specified value. More... | |
| template<typename T , require_not_var_matrix_t< T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | log1m (const T &x) |
| Vectorized version of log1m(). More... | |
| double | log1m_exp (double a) |
| Calculates the natural logarithm of one minus the exponential of the specified value without overflow,. More... | |
| template<typename T , require_not_var_matrix_t< T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | log1m_exp (const T &x) |
| Vectorized version of log1m_exp(). More... | |
| double | log1m_inv_logit (double u) |
| Returns the natural logarithm of 1 minus the inverse logit of the specified argument. More... | |
| double | log1m_inv_logit (int u) |
| Return the natural logarithm of one minus the inverse logit of the specified argument. More... | |
| template<typename T , require_not_var_matrix_t< T > * = nullptr, require_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| apply_scalar_unary< log1m_inv_logit_fun, T >::return_t | log1m_inv_logit (const T &x) |
Return the elementwise application of log1m_inv_logit() to specified argument container. More... | |
| double | log1p (double x) |
| Return the natural logarithm of one plus the specified value. More... | |
| double | log1p (int x) |
| Return the natural logarithm of one plus the specified argument. More... | |
| template<typename T , require_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | log1p (const T &x) |
Return the elementwise application of log1p() to specified argument container. More... | |
| double | log1p_exp (double a) |
| Calculates the log of 1 plus the exponential of the specified value without overflow. More... | |
| template<typename T , require_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | log1p_exp (const T &x) |
| Vectorized version of log1p_exp(). More... | |
| double | log2 () |
| Return natural logarithm of two. More... | |
| template<typename T , require_not_var_matrix_t< T > * = nullptr, require_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | log2 (const T &x) |
Return the elementwise application of log2() to specified argument container. More... | |
| template<typename T , require_not_rev_matrix_t< T > * = nullptr> | |
| value_type_t< T > | log_determinant_ldlt (LDLT_factor< T > &A) |
| Returns log(abs(det(A))) given a LDLT_factor of A. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr, require_not_vt_var< EigMat > * = nullptr> | |
| value_type_t< EigMat > | log_determinant_spd (const EigMat &m) |
| Returns the log absolute determinant of the specified square matrix. More... | |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| return_type_t< T1, T2 > | log_diff_exp (const T1 x, const T2 y) |
| The natural logarithm of the difference of the natural exponentiation of x and the natural exponentiation of y. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | log_diff_exp (const T1 &a, const T2 &b) |
| Enables the vectorised application of the log_diff_exp function, when the first and/or second arguments are containers. More... | |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| return_type_t< T1, T2 > | log_falling_factorial (const T1 x, const T2 n) |
| Return the natural log of the falling factorial of the specified arguments. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | log_falling_factorial (const T1 &a, const T2 &b) |
| Enables the vectorised application of the log_falling_factorial function, when the first and/or second arguments are containers. More... | |
| double | log_inv_logit (double u) |
| Returns the natural logarithm of the inverse logit of the specified argument. More... | |
| double | log_inv_logit (int u) |
| Returns the natural logarithm of the inverse logit of the specified argument. More... | |
| template<typename T , require_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | log_inv_logit (const T &x) |
Return the elementwise application of log_inv_logit() to specified argument container. More... | |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| return_type_t< T1, T2 > | log_inv_logit_diff (const T1 &x, const T2 &y) |
| Returns the natural logarithm of the difference of the inverse logits of the specified arguments. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | log_inv_logit_diff (const T1 &a, const T2 &b) |
| Enables the vectorised application of the log_inv_logit_diff function, when the first and/or second arguments are containers. More... | |
| template<typename T_theta , typename T_lambda1 , typename T_lambda2 , require_all_arithmetic_t< T_theta, T_lambda1, T_lambda2 > * = nullptr> | |
| double | log_mix (T_theta theta, T_lambda1 lambda1, T_lambda2 lambda2) |
| Return the log mixture density with specified mixing proportion and log densities. More... | |
| template<typename T_theta , typename T_lam , require_any_vector_t< T_theta, T_lam > * = nullptr> | |
| return_type_t< T_theta, T_lam > | log_mix (const T_theta &theta, const T_lam &lambda) |
| Return the log mixture density with specified mixing proportions and log densities. More... | |
| template<typename T_theta , typename T_lam , require_vector_t< T_lam > * = nullptr> | |
| return_type_t< T_theta, std::vector< T_lam > > | log_mix (const T_theta &theta, const std::vector< T_lam > &lambda) |
| Return the log mixture density given specified mixing proportions and array of log density vectors. More... | |
| template<typename T1 , typename T2 , require_all_stan_scalar_t< T1, T2 > * = nullptr> | |
| return_type_t< T1, T2, double > | log_modified_bessel_first_kind (const T1 v, const T2 z) |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | log_modified_bessel_first_kind (const T1 &a, const T2 &b) |
| Enables the vectorised application of the log_modified_bessel_first_kind function, when the first and/or second arguments are containers. More... | |
| template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr> | |
| return_type_t< T1, T2 > | log_rising_factorial (const T1 &x, const T2 &n) |
| Return the natural logarithm of the rising factorial from the first specified argument to the second. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | log_rising_factorial (const T1 &a, const T2 &b) |
| Enables the vectorised application of the log_rising_factorial function, when the first and/or second arguments are containers. More... | |
| template<typename Container , require_st_arithmetic< Container > * = nullptr, require_container_t< Container > * = nullptr> | |
| auto | log_softmax (const Container &x) |
| Return the natural logarithm of the softmax of the specified vector. More... | |
| template<typename T1 , typename T2 , require_all_not_st_var< T1, T2 > * = nullptr> | |
| return_type_t< T1, T2 > | log_sum_exp (const T2 &a, const T1 &b) |
| Calculates the log sum of exponentials without overflow. More... | |
| template<typename T , typename = require_autodiff_t<T>> | |
| double | logb (const T &x) |
| Returns the value of the unbiased radix-independent exponent from the floating-point argument. More... | |
| template<typename T1 , typename T2 > | |
| int | logical_and (const T1 x1, const T2 x2) |
| The logical and function which returns 1 if both arguments are unequal to zero and 0 otherwise. More... | |
| template<typename T1 , typename T2 > | |
| int | logical_eq (const T1 x1, const T2 x2) |
| Return 1 if the first argument is equal to the second. More... | |
| template<typename T1 , typename T2 > | |
| bool | logical_gt (const T1 x1, const T2 x2) |
| Return 1 if the first argument is strictly greater than the second. More... | |
| template<typename T1 , typename T2 > | |
| bool | logical_gte (const T1 x1, const T2 x2) |
| Return 1 if the first argument is greater than or equal to the second. More... | |
| template<typename T1 , typename T2 > | |
| bool | logical_lt (T1 x1, T2 x2) |
| Return 1 if the first argument is strictly less than the second. More... | |
| template<typename T1 , typename T2 > | |
| bool | logical_lte (const T1 x1, const T2 x2) |
| Return 1 if the first argument is less than or equal to the second. More... | |
| template<typename T > | |
| int | logical_negation (const T &x) |
| The logical negation function which returns one if the input is equal to zero and zero otherwise. More... | |
| template<typename T1 , typename T2 > | |
| int | logical_neq (const T1 x1, const T2 x2) |
| Return 1 if the first argument is unequal to the second. More... | |
| template<typename T1 , typename T2 > | |
| int | logical_or (T1 x1, T2 x2) |
| The logical or function which returns 1 if either argument is unequal to zero and 0 otherwise. More... | |
| double | logit (double u) |
| Return the log odds of the argument. More... | |
| double | logit (int u) |
| Return the log odds of the argument. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | logit (const Container &x) |
Return the elementwise application of logit() to specified argument container. More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | logit (const Container &x) |
| Version of logit() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename T , typename L , typename U , require_all_stan_scalar_t< T, L, U > * = nullptr, require_not_var_t< return_type_t< T, L, U >> * = nullptr> | |
| auto | lub_constrain (T &&x, L &&lb, U &&ub) |
| Return the lower and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds. More... | |
| template<typename T , typename L , typename U , require_all_stan_scalar_t< T, L, U > * = nullptr, require_not_var_t< return_type_t< T, L, U >> * = nullptr> | |
| auto | lub_constrain (T &&x, L &&lb, U &&ub, return_type_t< T, L, U > &lp) |
| Return the lower- and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds and increment the specified log density with the log absolute Jacobian determinant. More... | |
| template<typename T , typename L , typename U , require_eigen_t< T > * = nullptr, require_all_stan_scalar_t< L, U > * = nullptr, require_not_var_t< return_type_t< T, L, U >> * = nullptr> | |
| auto | lub_constrain (const T &x, const L &lb, const U &ub) |
| Overload for Eigen matrix and scalar bounds. More... | |
| template<typename T , typename L , typename U , require_eigen_t< T > * = nullptr, require_all_stan_scalar_t< L, U > * = nullptr, require_not_var_t< return_type_t< T, L, U >> * = nullptr> | |
| auto | lub_constrain (const T &x, const L &lb, const U &ub, return_type_t< T, L, U > &lp) |
| Overload for Eigen matrix and scalar bounds plus lp. More... | |
| template<typename T , typename L , typename U , require_all_eigen_t< T, L, U > * = nullptr, require_not_var_t< return_type_t< T, L, U >> * = nullptr> | |
| auto | lub_constrain (const T &x, const L &lb, const U &ub) |
| Overload for Eigen matrix and matrix bounds. More... | |
| template<typename T , typename L , typename U , require_all_not_std_vector_t< L, U > * = nullptr> | |
| auto | lub_constrain (const std::vector< T > &x, const L &lb, const U &ub) |
| Overload for array of x and non-array lb and ub. More... | |
| template<typename T , typename L , typename U , require_all_not_std_vector_t< L, U > * = nullptr> | |
| auto | lub_constrain (const std::vector< T > &x, const L &lb, const U &ub, return_type_t< T, L, U > &lp) |
| Overload for array of x and non-array lb and ub with lp. More... | |
| template<typename T , typename L , typename U , require_not_std_vector_t< L > * = nullptr> | |
| auto | lub_constrain (const std::vector< T > &x, const L &lb, const std::vector< U > &ub) |
| Overload for array of x and ub and non-array lb. More... | |
| template<typename T , typename L , typename U , require_not_std_vector_t< L > * = nullptr> | |
| auto | lub_constrain (const std::vector< T > &x, const L &lb, const std::vector< U > &ub, return_type_t< T, L, U > &lp) |
| Overload for array of x and ub and non-array lb with lp. More... | |
| template<typename T , typename L , typename U , require_not_std_vector_t< U > * = nullptr> | |
| auto | lub_constrain (const std::vector< T > &x, const std::vector< L > &lb, const U &ub) |
| Overload for array of x and lb and non-array ub. More... | |
| template<typename T , typename L , typename U , require_not_std_vector_t< U > * = nullptr> | |
| auto | lub_constrain (const std::vector< T > &x, const std::vector< L > &lb, const U &ub, return_type_t< T, L, U > &lp) |
| Overload for array of x and lb and non-array ub with lp. More... | |
| template<typename T , typename L , typename U > | |
| auto | lub_constrain (const std::vector< T > &x, const std::vector< L > &lb, const std::vector< U > &ub) |
| Overload for array of x, lb, and ub with lp. More... | |
| template<typename T , typename L , typename U > | |
| auto | lub_constrain (const std::vector< T > &x, const std::vector< L > &lb, const std::vector< U > &ub, return_type_t< T, L, U > &lp) |
| Overload for array of x, lb, and ub. More... | |
| template<bool Jacobian, typename T , typename L , typename U > | |
| auto | lub_constrain (const T &x, const L &lb, const U &ub, return_type_t< T, L, U > &lp) |
| Return the lower and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds. More... | |
| template<typename T > | |
| Eigen::Array< T, Eigen::Dynamic, 1 > | make_nu (const T &eta, size_t K) |
| Return the degrees of freedom for the t distribution that corresponds to the shape parameter in the LKJ distribution. More... | |
| template<typename T , typename = require_eigen_t<T>> | |
| plain_type_t< T > | matrix_exp (const T &A_in) |
| Return the matrix exponential of the input matrix. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | matrix_exp_2x2 (const EigMat &A) |
| Return the matrix exponential of a 2x2 matrix. More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_all_st_same< double, EigMat1, EigMat2 > * = nullptr> | |
| Eigen::Matrix< double, Eigen::Dynamic, EigMat2::ColsAtCompileTime > | matrix_exp_multiply (const EigMat1 &A, const EigMat2 &B) |
| Return product of exp(A) and B, where A is a NxN double matrix, B is a NxCb double matrix, and t is a double. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::ColsAtCompileTime > | matrix_exp_pade (const EigMat &arg) |
| Computes the matrix exponential, using a Pade approximation, coupled with scaling and squaring. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr, require_not_vt_var< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::ColsAtCompileTime > | matrix_power (const EigMat &M, const int n) |
| Returns the nth power of the specific matrix. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, EigMat::RowsAtCompileTime, EigMat::ColsAtCompileTime > | operator^ (const EigMat &M, const int n) |
| template<typename T , require_container_t< T > * = nullptr> | |
| value_type_t< T > | max (const T &m) |
| Returns the maximum coefficient in the specified matrix, vector, row vector or std vector. More... | |
| template<typename T1 , typename... Ts> | |
| size_t | max_size (const T1 &x1, const Ts &...xs) |
| Calculate the size of the largest input. More... | |
| template<typename T1 , typename... Ts> | |
| size_t | max_size_mvt (const T1 &x1, const Ts &...xs) |
| Calculate the size of the largest multivariate input. More... | |
| template<typename T1 , typename T2 , require_all_eigen_vt< std::is_arithmetic, T1, T2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< T1, T2 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > | mdivide_left (const T1 &A, const T2 &b) |
| Returns the solution of the system Ax=b. More... | |
| template<typename T , typename EigMat , require_eigen_t< EigMat > * = nullptr, require_all_not_st_var< T, EigMat > * = nullptr, require_any_not_t< std::is_arithmetic< value_type_t< T >>, is_fvar< value_type_t< EigMat >>> * = nullptr> | |
| Eigen::Matrix< return_type_t< T, EigMat >, Eigen::Dynamic, EigMat::ColsAtCompileTime > | mdivide_left_ldlt (LDLT_factor< T > &A, const EigMat &b) |
| Returns the solution of the system Ax=b given an LDLT_factor of A. More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_all_not_vt_var< EigMat1, EigMat2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< EigMat1, EigMat2 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_left_spd (const EigMat1 &A, const EigMat2 &b) |
| Returns the solution of the system Ax=b where A is symmetric positive definite. More... | |
| template<Eigen::UpLoType TriView, typename T1 , typename T2 , require_all_eigen_t< T1, T2 > * = nullptr, require_all_not_eigen_vt< is_var, T1, T2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< T1, T2 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > | mdivide_left_tri (const T1 &A, const T2 &b) |
| Returns the solution of the system Ax=b when A is triangular. More... | |
| template<Eigen::UpLoType TriView, typename T , require_eigen_t< T > * = nullptr> | |
| plain_type_t< T > | mdivide_left_tri (const T &A) |
| Returns the solution of the system Ax=b when A is triangular and b=I. More... | |
| template<typename T1 , typename T2 , require_all_eigen_t< T1, T2 > * = nullptr, require_all_not_eigen_vt< is_fvar, T1, T2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< T1, T2 >, T1::RowsAtCompileTime, T2::ColsAtCompileTime > | mdivide_left_tri_low (const T1 &A, const T2 &b) |
| Return the result of left dividing the second argument by the first argument. More... | |
| template<typename T , require_eigen_t< T > * = nullptr, require_not_eigen_vt< is_fvar, T > * = nullptr> | |
| plain_type_t< T > | mdivide_left_tri_low (const T &A) |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_all_not_vt_fvar< EigMat1, EigMat2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< EigMat1, EigMat2 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_right (const EigMat1 &b, const EigMat2 &A) |
| Returns the solution of the system xA=b. More... | |
| template<typename EigMat , typename T , require_all_matrix_t< EigMat, T > * = nullptr, require_any_not_st_arithmetic< EigMat, T > * = nullptr> | |
| auto | mdivide_right_ldlt (const EigMat &b, LDLT_factor< T > &A) |
| Returns the solution of the system xA=b given an LDLT_factor of A. More... | |
| template<typename EigMat , typename T , require_all_matrix_t< EigMat, T > * = nullptr, require_all_st_arithmetic< EigMat, T > * = nullptr> | |
| Eigen::Matrix< double, EigMat::RowsAtCompileTime, T::ColsAtCompileTime > | mdivide_right_ldlt (const EigMat &b, LDLT_factor< T > &A) |
| Returns the solution of the system xA=b given an LDLT_factor of A. More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< EigMat1, EigMat2 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_right_spd (const EigMat1 &b, const EigMat2 &A) |
| Returns the solution of the system xA=b where A is symmetric positive definite. More... | |
| template<Eigen::UpLoType TriView, typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< EigMat1, EigMat2 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_right_tri (const EigMat1 &b, const EigMat2 &A) |
| Returns the solution of the system xA=b when A is triangular. More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_all_not_vt_fvar< EigMat1, EigMat2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< EigMat1, EigMat2 >, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_right_tri_low (const EigMat1 &b, const EigMat2 &A) |
| Returns the solution of the system x tri(A) = b when tri(A) is a lower triangular view of the matrix A. More... | |
| template<typename T , require_container_t< T > * = nullptr> | |
| return_type_t< T > | mean (const T &m) |
| Returns the sample mean (i.e., average) of the coefficients in the specified std vector, vector, row vector, or matrix. More... | |
| template<typename T , require_container_t< T > * = nullptr> | |
| value_type_t< T > | min (const T &m) |
| Returns the minimum coefficient in the specified matrix, vector, row vector or std vector. More... | |
| template<typename T > | |
| auto | minus (const T &x) |
| Returns the negation of the specified scalar or matrix. More... | |
| template<typename T2 , require_arithmetic_t< T2 > * = nullptr> | |
| T2 | modified_bessel_first_kind (int v, const T2 z) |
\[ \mbox{modified\_bessel\_first\_kind}(v, z) = \begin{cases} I_v(z) & \mbox{if } -\infty\leq z \leq \infty \\[6pt] \textrm{error} & \mbox{if } z = \textrm{NaN} \end{cases} \] More... | |
| double | modified_bessel_first_kind (int v, int z) |
| This function exists because when z is of type integer, cyl_bessel_i(v, z) returns an integer. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | modified_bessel_first_kind (const T1 &a, const T2 &b) |
| Enables the vectorised application of the modified_bessel_first_kind function, when the first and/or second arguments are containers. More... | |
| template<typename T2 , require_arithmetic_t< T2 > * = nullptr> | |
| T2 | modified_bessel_second_kind (int v, const T2 z) |
\[ \mbox{modified\_bessel\_second\_kind}(v, z) = \begin{cases} \textrm{error} & \mbox{if } z \leq 0 \\ K_v(z) & \mbox{if } z > 0 \\[6pt] \textrm{NaN} & \mbox{if } z = \textrm{NaN} \end{cases} \] More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | modified_bessel_second_kind (const T1 &a, const T2 &b) |
| Enables the vectorised application of the modified_bessel_second_kind function, when the first and/or second arguments are containers. More... | |
| int | modulus (int x, int y) |
| template<typename Mat , typename Scal , require_stan_scalar_t< Scal > * = nullptr, require_eigen_t< Mat > * = nullptr, require_all_not_st_var< Scal, Mat > * = nullptr> | |
| auto | multiply (const Mat &m, Scal c) |
| Return specified matrix multiplied by specified scalar. More... | |
| template<typename Scal , typename Mat , require_stan_scalar_t< Scal > * = nullptr, require_eigen_t< Mat > * = nullptr, require_all_not_st_var< Scal, Mat > * = nullptr> | |
| auto | multiply (Scal c, const Mat &m) |
| Return specified scalar multiplied by specified matrix. More... | |
| template<typename Mat1 , typename Mat2 , require_all_eigen_vt< std::is_arithmetic, Mat1, Mat2 > * = nullptr, require_not_eigen_row_and_col_t< Mat1, Mat2 > * = nullptr> | |
| auto | multiply (const Mat1 &m1, const Mat2 &m2) |
| Return the product of the specified matrices. More... | |
| template<typename RowVec , typename ColVec , require_not_var_t< return_type_t< RowVec, ColVec >> * = nullptr, require_eigen_row_and_col_t< RowVec, ColVec > * = nullptr> | |
| auto | multiply (const RowVec &rv, const ColVec &v) |
| Return the scalar product of the specified row vector and specified column vector. More... | |
| template<typename Scalar1 , typename Scalar2 , require_all_stan_scalar_t< Scalar1, Scalar2 > * = nullptr> | |
| return_type_t< Scalar1, Scalar2 > | multiply (Scalar1 m, Scalar2 c) |
| Return product of scalars. More... | |
| template<typename T_a , typename T_b , require_all_arithmetic_t< T_a, T_b > * = nullptr> | |
| return_type_t< T_a, T_b > | multiply_log (const T_a a, const T_b b) |
| Calculate the value of the first argument times log of the second argument while behaving properly with 0 inputs. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr, require_all_not_var_matrix_t< T1, T2 > * = nullptr> | |
| auto | multiply_log (const T1 &a, const T2 &b) |
| Enables the vectorised application of the multiply_log function, when the first and/or second arguments are containers. More... | |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr, require_not_st_autodiff< EigMat > * = nullptr> | |
| matrix_d | multiply_lower_tri_self_transpose (const EigMat &L) |
| Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose. More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| int | num_elements (const T &x) |
| Returns 1, the number of elements in a primitive type. More... | |
| template<typename T > | |
| int | num_elements (const std::vector< T > &v) |
| Returns the number of elements in the specified vector. More... | |
| template<typename T , typename M , typename S , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T, M, S > * = nullptr> | |
| auto | offset_multiplier_constrain (const T &x, const M &mu, const S &sigma) |
| Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier. More... | |
| template<typename T , typename M , typename S , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T, M, S > * = nullptr> | |
| auto | offset_multiplier_constrain (const T &x, const M &mu, const S &sigma, return_type_t< T, M, S > &lp) |
| Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier, incrementing the specified reference with the log absolute Jacobian determinant of the transform. More... | |
| template<typename T , typename M , typename S , require_all_not_std_vector_t< M, S > * = nullptr> | |
| auto | offset_multiplier_constrain (const std::vector< T > &x, const M &mu, const S &sigma) |
| Overload for array of x and non-array mu and sigma. More... | |
| template<typename T , typename M , typename S , require_all_not_std_vector_t< M, S > * = nullptr> | |
| auto | offset_multiplier_constrain (const std::vector< T > &x, const M &mu, const S &sigma, return_type_t< T, M, S > &lp) |
| Overload for array of x and non-array mu and sigma with lp. More... | |
| template<typename T , typename M , typename S , require_not_std_vector_t< M > * = nullptr> | |
| auto | offset_multiplier_constrain (const std::vector< T > &x, const M &mu, const std::vector< S > &sigma) |
| Overload for array of x and sigma and non-array mu. More... | |
| template<typename T , typename M , typename S , require_not_std_vector_t< M > * = nullptr> | |
| auto | offset_multiplier_constrain (const std::vector< T > &x, const M &mu, const std::vector< S > &sigma, return_type_t< T, M, S > &lp) |
| Overload for array of x and sigma and non-array mu with lp. More... | |
| template<typename T , typename M , typename S , require_not_std_vector_t< S > * = nullptr> | |
| auto | offset_multiplier_constrain (const std::vector< T > &x, const std::vector< M > &mu, const S &sigma) |
| Overload for array of x and mu and non-array sigma. More... | |
| template<typename T , typename M , typename S , require_not_std_vector_t< S > * = nullptr> | |
| auto | offset_multiplier_constrain (const std::vector< T > &x, const std::vector< M > &mu, const S &sigma, return_type_t< T, M, S > &lp) |
| Overload for array of x and mu and non-array sigma with lp. More... | |
| template<typename T , typename M , typename S > | |
| auto | offset_multiplier_constrain (const std::vector< T > &x, const std::vector< M > &mu, const std::vector< S > &sigma) |
| Overload for array of x, mu, and sigma. More... | |
| template<typename T , typename M , typename S > | |
| auto | offset_multiplier_constrain (const std::vector< T > &x, const std::vector< M > &mu, const std::vector< S > &sigma, return_type_t< T, M, S > &lp) |
| Overload for array of x, mu, and sigma with lp. More... | |
| template<typename T , typename M , typename S > | |
| auto | offset_multiplier_free (const T &y, const M &mu, const S &sigma) |
| Return the unconstrained variable that transforms to the specified offset and multiplier constrained variable given the specified offset and multiplier. More... | |
| template<typename T , typename M , typename S , require_all_not_std_vector_t< M, S > * = nullptr> | |
| auto | offset_multiplier_free (const std::vector< T > &x, const M &mu, const S &sigma) |
| Overload for array of x and non-array mu and sigma. More... | |
| template<typename T , typename M , typename S , require_not_std_vector_t< M > * = nullptr> | |
| auto | offset_multiplier_free (const std::vector< T > &x, const M &mu, const std::vector< S > &sigma) |
| Overload for array of x and sigma and non-array mu. More... | |
| template<typename T , typename M , typename S , require_not_std_vector_t< S > * = nullptr> | |
| auto | offset_multiplier_free (const std::vector< T > &x, const std::vector< M > &mu, const S &sigma) |
| Overload for array of x and mu and non-array sigma. More... | |
| template<typename T , typename M , typename S > | |
| auto | offset_multiplier_free (const std::vector< T > &x, const std::vector< M > &mu, const std::vector< S > &sigma) |
| Overload for array of x, mu, and sigma. More... | |
| std::vector< double > | one_hot_array (int K, int k) |
| Return an array with 1 in the k-th position and zero elsewhere. More... | |
| std::vector< int > | one_hot_int_array (int K, int k) |
| Return an integer array with 1 in the k-th position and zero elsewhere. More... | |
| Eigen::RowVectorXd | one_hot_row_vector (int K, int k) |
| Return a row vector with 1 in the k-th position and zero elsewhere. More... | |
| Eigen::VectorXd | one_hot_vector (int K, int k) |
| Return a vector with 1 in the k-th position and zero elsewhere. More... | |
| std::vector< double > | ones_array (int K) |
| Return an array of ones. More... | |
| std::vector< int > | ones_int_array (int K) |
| Return an integer array of ones. More... | |
| auto | ones_row_vector (int K) |
| Return a row vector of ones. More... | |
| auto | ones_vector (int K) |
| Return a vector of ones. More... | |
| template<typename EigVec , require_eigen_col_vector_t< EigVec > * = nullptr, require_not_st_var< EigVec > * = nullptr> | |
| plain_type_t< EigVec > | ordered_constrain (const EigVec &x) |
| Return an increasing ordered vector derived from the specified free vector. More... | |
| template<typename EigVec , require_eigen_col_vector_t< EigVec > * = nullptr> | |
| auto | ordered_constrain (const EigVec &x, value_type_t< EigVec > &lp) |
| Return a positive valued, increasing ordered vector derived from the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More... | |
| template<bool Jacobian, typename T , require_not_std_vector_t< T > * = nullptr> | |
| auto | ordered_constrain (const T &x, return_type_t< T > &lp) |
| Return a positive valued, increasing ordered vector derived from the specified free vector. More... | |
| template<typename EigVec , require_eigen_col_vector_t< EigVec > * = nullptr> | |
| plain_type_t< EigVec > | ordered_free (const EigVec &y) |
| Return the vector of unconstrained scalars that transform to the specified positive ordered vector. More... | |
| template<typename T , require_std_vector_t< T > * = nullptr> | |
| auto | ordered_free (const T &x) |
Overload of ordered_free() to untransform each Eigen vector in a standard vector. More... | |
| double | owens_t (double h, double a) |
| Return the result of applying Owen's T function to the specified arguments. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | owens_t (const T1 &a, const T2 &b) |
| Enables the vectorised application of the owens_t function, when the first and/or second arguments are containers. More... | |
| double | Phi (double x) |
| The unit normal cumulative distribution function. More... | |
| template<typename T , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | Phi (const T &x) |
| Vectorized version of Phi(). More... | |
| double | Phi_approx (double x) |
| Return an approximation of the unit normal CDF. More... | |
| double | Phi_approx (int x) |
| Return an approximation of the unit normal CDF. More... | |
| template<typename T , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | Phi_approx (const T &x) |
Return the elementwise application of Phi_approx() to specified argument container. More... | |
| template<typename T > | |
| T | plus (T &&x) |
| Returns the unary plus of the input. More... | |
| template<typename T_theta , typename T_scalar = scalar_type_t<T_theta>, require_eigen_vector_t< T_theta > * = nullptr> | |
| plain_type_t< T_theta > | poisson_binomial_log_probs (int y, const T_theta &theta) |
| Returns the last row of the log probability matrix of the Poisson-Binomial distribution given the number of successes and a vector of success probabilities. More... | |
| template<typename T_y , typename T_theta , require_vt_integral< T_y > * = nullptr> | |
| auto | poisson_binomial_log_probs (const T_y &y, const T_theta &theta) |
| std::complex< double > | polar (double r, double theta) |
| Returns the complex number with specified magnitude and phase angle. More... | |
| std::complex< double > | polar (double r, int theta) |
| std::complex< double > | polar (int r, double theta) |
| std::complex< double > | polar (int r, int theta) |
| template<typename T > | |
| auto | positive_constrain (const T &x) |
| Return the positive value for the specified unconstrained input. More... | |
| template<typename T , typename S > | |
| auto | positive_constrain (const T &x, S &lp) |
| Return the positive value for the specified unconstrained input, incrementing the scalar reference with the log absolute Jacobian determinant. More... | |
| template<bool Jacobian, typename T , require_not_std_vector_t< T > * = nullptr> | |
| auto | positive_constrain (const T &x, return_type_t< T > &lp) |
| Return the positive value for the specified unconstrained input. More... | |
| template<typename T > | |
| T | positive_free (const T &y) |
| Return the unconstrained value corresponding to the specified positive-constrained value. More... | |
| template<typename EigVec , require_eigen_col_vector_t< EigVec > * = nullptr, require_not_st_var< EigVec > * = nullptr> | |
| auto | positive_ordered_constrain (const EigVec &x) |
| Return an increasing positive ordered vector derived from the specified free vector. More... | |
| template<typename Vec , require_col_vector_t< Vec > * = nullptr> | |
| auto | positive_ordered_constrain (const Vec &x, return_type_t< Vec > &lp) |
| Return a positive valued, increasing positive ordered vector derived from the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More... | |
| template<bool Jacobian, typename Vec , require_not_std_vector_t< Vec > * = nullptr> | |
| auto | positive_ordered_constrain (const Vec &x, return_type_t< Vec > &lp) |
| Return a positive valued, increasing positive ordered vector derived from the specified free vector. More... | |
| template<bool Jacobian, typename T , require_std_vector_t< T > * = nullptr> | |
| auto | positive_ordered_constrain (const T &x, return_type_t< T > &lp) |
| Return a positive valued, increasing positive ordered vector derived from the specified free vector. More... | |
| template<typename EigVec , require_eigen_col_vector_t< EigVec > * = nullptr> | |
| auto | positive_ordered_free (const EigVec &y) |
| Return the vector of unconstrained scalars that transform to the specified positive ordered vector. More... | |
| template<typename T , require_std_vector_t< T > * = nullptr> | |
| auto | positive_ordered_free (const T &x) |
Overload of positive_ordered_free() to untransform each Eigen vector in a standard vector. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | pow (const T1 &a, const T2 &b) |
| Enables the vectorised application of the pow function, when the first and/or second arguments are containers. More... | |
| template<typename T > | |
| std::enable_if< std::is_arithmetic< T >::value, T >::type | primitive_value (T x) |
| Return the value of the specified arithmetic argument unmodified with its own declared type. More... | |
| template<typename T > | |
| std::enable_if<!std::is_arithmetic< T >::value, double >::type | primitive_value (const T &x) |
| Return the primitive value of the specified argument. More... | |
| template<typename T > | |
| T | prob_constrain (const T &x) |
| Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar. More... | |
| template<typename T > | |
| T | prob_constrain (const T &x, T &lp) |
| Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More... | |
| template<bool Jacobian, typename T > | |
| auto | prob_constrain (const T &x, T &lp) |
| Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar. More... | |
| template<typename T > | |
| T | prob_free (const T &y) |
| Return the free scalar that when transformed to a probability produces the specified scalar. More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| T | prod (const T &v) |
| Returns the product of given scalar. More... | |
| template<typename T > | |
| T | prod (const std::vector< T > &v) |
| Returns the product of the coefficients of the specified standard vector. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| value_type_t< EigMat > | prod (const EigMat &v) |
| Returns the product of the coefficients of the specified column vector. More... | |
| template<typename T , typename S > | |
| promote_scalar_type< T, S >::type | promote_scalar (const S &x) |
| This is the top-level function to call to promote the scalar types of an input of type S to type T. More... | |
| template<typename T > | |
| Eigen::Matrix< T,-1,-1 > | pseudo_eigenvalues (const Eigen::Matrix< T,-1,-1 > &m) |
| template<typename T > | |
| Eigen::Matrix< T,-1,-1 > | pseudo_eigenvectors (const Eigen::Matrix< T,-1,-1 > &m) |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | qr_Q (const EigMat &m) |
| Returns the orthogonal factor of the fat QR decomposition. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | qr_R (const EigMat &m) |
| Returns the upper triangular factor of the fat QR decomposition. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | qr_thin_Q (const EigMat &m) |
| Returns the orthogonal factor of the thin QR decomposition. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | qr_thin_R (const EigMat &m) |
| Returns the upper triangular factor of the thin QR decomposition. More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_not_eigen_col_vector_t< EigMat2 > * = nullptr, require_vt_same< EigMat1, EigMat2 > * = nullptr, require_all_vt_arithmetic< EigMat1, EigMat2 > * = nullptr> | |
| auto | quad_form (const EigMat1 &A, const EigMat2 &B) |
| Return the quadratic form \( B^T A B \). More... | |
| template<typename EigMat , typename ColVec , require_eigen_t< EigMat > * = nullptr, require_eigen_col_vector_t< ColVec > * = nullptr, require_vt_same< EigMat, ColVec > * = nullptr, require_all_vt_arithmetic< EigMat, ColVec > * = nullptr> | |
| value_type_t< EigMat > | quad_form (const EigMat &A, const ColVec &B) |
| Return the quadratic form \( B^T A B \). More... | |
| template<typename EigMat , typename EigVec , require_eigen_t< EigMat > * = nullptr, require_eigen_vector_t< EigVec > * = nullptr> | |
| auto | quad_form_diag (const EigMat &mat, const EigVec &vec) |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_not_eigen_col_vector_t< EigMat2 > * = nullptr, require_vt_same< EigMat1, EigMat2 > * = nullptr, require_all_vt_arithmetic< EigMat1, EigMat2 > * = nullptr> | |
| plain_type_t< EigMat2 > | quad_form_sym (const EigMat1 &A, const EigMat2 &B) |
| Return the quadratic form \( B^T A B \) of a symmetric matrix. More... | |
| template<typename EigMat , typename ColVec , require_eigen_t< EigMat > * = nullptr, require_eigen_col_vector_t< ColVec > * = nullptr, require_vt_same< EigMat, ColVec > * = nullptr, require_all_vt_arithmetic< EigMat, ColVec > * = nullptr> | |
| value_type_t< EigMat > | quad_form_sym (const EigMat &A, const ColVec &B) |
| Return the quadratic form \( B^T A B \) of a symmetric matrix. More... | |
| template<typename T , require_vector_t< T > * = nullptr, require_vector_vt< std::is_arithmetic, T > * = nullptr> | |
| double | quantile (const T &samples_vec, const double p) |
| Return sample quantiles corresponding to the given probabilities. More... | |
| template<typename T , typename Tp , require_all_vector_t< T, Tp > * = nullptr, require_vector_vt< std::is_arithmetic, T > * = nullptr, require_std_vector_vt< std::is_arithmetic, Tp > * = nullptr> | |
| std::vector< double > | quantile (const T &samples_vec, const Tp &ps) |
| Return sample quantiles corresponding to the given probabilities. More... | |
| template<typename C , require_container_t< C > * = nullptr> | |
| int | rank (const C &v, int s) |
| Return the number of components of v less than v[s]. More... | |
| template<typename T , require_eigen_vector_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | read_corr_L (const T &CPCs, size_t K) |
| Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations. More... | |
| template<typename T , require_eigen_vector_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | read_corr_L (const T &CPCs, size_t K, value_type_t< T > &log_prob) |
| Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation. More... | |
| template<typename T_CPCs , require_eigen_vector_t< T_CPCs > * = nullptr> | |
| Eigen::Matrix< value_type_t< T_CPCs >, Eigen::Dynamic, Eigen::Dynamic > | read_corr_matrix (const T_CPCs &CPCs, size_t K) |
| Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations. More... | |
| template<typename T_CPCs , require_eigen_vector_t< T_CPCs > * = nullptr> | |
| Eigen::Matrix< value_type_t< T_CPCs >, Eigen::Dynamic, Eigen::Dynamic > | read_corr_matrix (const T_CPCs &CPCs, size_t K, value_type_t< T_CPCs > &log_prob) |
| Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation. More... | |
| template<typename T_CPCs , typename T_sds , require_all_eigen_vector_t< T_CPCs, T_sds > * = nullptr, require_vt_same< T_CPCs, T_sds > * = nullptr> | |
| Eigen::Matrix< value_type_t< T_CPCs >, Eigen::Dynamic, Eigen::Dynamic > | read_cov_L (const T_CPCs &CPCs, const T_sds &sds, value_type_t< T_CPCs > &log_prob) |
| This is the function that should be called prior to evaluating the density of any elliptical distribution. More... | |
| template<typename T_CPCs , typename T_sds , require_all_eigen_vector_t< T_CPCs, T_sds > * = nullptr, require_vt_same< T_CPCs, T_sds > * = nullptr> | |
| Eigen::Matrix< value_type_t< T_CPCs >, Eigen::Dynamic, Eigen::Dynamic > | read_cov_matrix (const T_CPCs &CPCs, const T_sds &sds, value_type_t< T_CPCs > &log_prob) |
| A generally worse alternative to call prior to evaluating the density of an elliptical distribution. More... | |
| template<typename T_CPCs , typename T_sds , require_all_eigen_vector_t< T_CPCs, T_sds > * = nullptr, require_vt_same< T_CPCs, T_sds > * = nullptr> | |
| Eigen::Matrix< value_type_t< T_CPCs >, Eigen::Dynamic, Eigen::Dynamic > | read_cov_matrix (const T_CPCs &CPCs, const T_sds &sds) |
| Builds a covariance matrix from CPCs and standard deviations. More... | |
| template<typename T , require_autodiff_t< T > > | |
| T | real (const std::complex< T > &z) |
| Return the real component of the complex argument. More... | |
| template<typename T_ret , typename In , require_std_vector_t< T_ret > * = nullptr> | |
| std::vector< plain_type_t< In > > | rep_array (const In &x, int n) |
| template<typename In > | |
| std::vector< plain_type_t< In > > | rep_array (const In &x, int n) |
| template<typename In > | |
| std::vector< std::vector< plain_type_t< In > > > | rep_array (const In &x, int m, int n) |
| template<typename In > | |
| std::vector< std::vector< std::vector< plain_type_t< In > > > > | rep_array (const In &x, int k, int m, int n) |
| template<typename Ret , typename T , require_eigen_matrix_dynamic_vt< is_stan_scalar, Ret > * = nullptr, require_stan_scalar_t< T > * = nullptr> | |
| auto | rep_matrix (const T &x, int m, int n) |
| Implementation of rep_matrix returning an Eigen matrix with scalar type equal to the input scalar type. More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| auto | rep_matrix (const T &x, int m, int n) |
| Default Implementation of rep_matrix returning an Eigen matrix with scalar type equal to the input scalar type. More... | |
| template<typename Vec , require_eigen_vector_t< Vec > * = nullptr> | |
| auto | rep_matrix (const Vec &x, int n) |
| Implementation of rep_matrix returning an Eigen matrix from an Eigen vector. More... | |
| template<typename T_ret , typename T , require_eigen_row_vector_t< T_ret > * = nullptr, require_stan_scalar_t< T > * = nullptr> | |
| auto | rep_row_vector (const T &x, int n) |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| auto | rep_row_vector (const T &x, int n) |
| template<typename T_ret , typename T , require_eigen_col_vector_t< T_ret > * = nullptr, require_stan_scalar_t< T > * = nullptr> | |
| auto | rep_vector (const T &x, int n) |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| auto | rep_vector (const T &x, int n) |
| template<typename T > | |
| void | resize (T &x, std::vector< int > dims) |
| Recursively resize the specified vector of vectors, which must bottom out at scalar values, Eigen vectors or Eigen matrices. More... | |
| template<typename T > | |
| std::vector< T > | reverse (const std::vector< T > &x) |
| Return a copy of the specified array in reversed order. More... | |
| template<typename T , typename = require_vector_t<T>> | |
| auto | reverse (const T &x) |
| Return a copy of the specified vector or row vector in reversed order. More... | |
| template<typename T , require_arithmetic_t< T > * = nullptr> | |
| return_type_t< T > | rising_factorial (const T &x, int n) |
| Return the rising factorial function evaluated at the inputs. More... | |
| template<typename T1 , typename T2 , require_any_container_t< T1, T2 > * = nullptr> | |
| auto | rising_factorial (const T1 &a, const T2 &b) |
| Enables the vectorised application of the rising_factorial function, when the first and/or second arguments are containers. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | round (const Container &x) |
Vectorized version of round(). More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | round (const Container &x) |
Version of round() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| auto | row (const T &m, size_t i) |
| Return the specified row of the specified matrix, using start-at-1 indexing. More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| int | rows (const T &m) |
| Return the number of rows in the specified matrix, vector, or row vector. More... | |
| template<typename Mat1 , typename Mat2 , require_all_eigen_t< Mat1, Mat2 > * = nullptr, require_all_not_eigen_vt< is_var, Mat1, Mat2 > * = nullptr> | |
| Eigen::Matrix< return_type_t< Mat1, Mat2 >, Mat1::RowsAtCompileTime, 1 > | rows_dot_product (const Mat1 &v1, const Mat2 &v2) |
| Returns the dot product of rows of the specified matrices. More... | |
| template<typename T , require_eigen_t< T > * = nullptr, require_not_st_var< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, T::RowsAtCompileTime, 1 > | rows_dot_self (const T &x) |
| Returns the dot product of each row of a matrix with itself. More... | |
| template<typename T , typename = require_autodiff_t<T>> | |
| double | scalbn (const T &x, int n) |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_vt< std::is_arithmetic, EigMat1, EigMat2 > * = nullptr> | |
| Eigen::Matrix< double, Eigen::Dynamic, EigMat2::ColsAtCompileTime > | scale_matrix_exp_multiply (const double &t, const EigMat1 &A, const EigMat2 &B) |
| Return product of exp(At) and B, where A is a NxN double matrix, B is a NxCb double matrix, and t is a double. More... | |
| template<typename Tt , typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_any_autodiff_t< Tt, value_type_t< EigMat1 >, value_type_t< EigMat2 >> * = nullptr> | |
| Eigen::Matrix< return_type_t< Tt, EigMat1, EigMat2 >, Eigen::Dynamic, EigMat2::ColsAtCompileTime > | scale_matrix_exp_multiply (const Tt &t, const EigMat1 &A, const EigMat2 &B) |
| Return product of exp(At) and B, where A is a NxN matrix, B is a NxCb matrix and t is a scalar. More... | |
| void | scaled_add (std::vector< double > &x, const std::vector< double > &y, double lambda) |
| template<typename T , require_container_t< T > * = nullptr, require_not_st_var< T > * = nullptr> | |
| auto | sd (const T &m) |
| Returns the unbiased sample standard deviation of the coefficients in the specified std vector, column vector, row vector, or matrix. More... | |
| template<typename Vec , require_vector_t< Vec > * = nullptr> | |
| auto | segment (const Vec &v, size_t i, size_t n) |
| Return the specified number of elements as a row/column vector starting from the specified element - 1 of the specified row/column vector. More... | |
| template<typename T > | |
| std::vector< T > | segment (const std::vector< T > &sv, size_t i, size_t n) |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| int | sign (const T &z) |
| template<typename ADType , require_autodiff_t< ADType > * = nullptr> | |
| bool | signbit (ADType &&v) |
Return true if the specified argument is negative and false otherwise. More... | |
| template<typename Vec , require_eigen_col_vector_t< Vec > * = nullptr, require_not_st_var< Vec > * = nullptr> | |
| auto | simplex_constrain (const Vec &y) |
| Return the simplex corresponding to the specified free vector. More... | |
| template<typename Vec , require_eigen_col_vector_t< Vec > * = nullptr, require_not_st_var< Vec > * = nullptr> | |
| auto | simplex_constrain (const Vec &y, value_type_t< Vec > &lp) |
| Return the simplex corresponding to the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More... | |
| template<bool Jacobian, typename Vec , require_not_std_vector_t< Vec > * = nullptr> | |
| auto | simplex_constrain (const Vec &y, return_type_t< Vec > &lp) |
| Return the simplex corresponding to the specified free vector. More... | |
| template<bool Jacobian, typename T , require_std_vector_t< T > * = nullptr> | |
| auto | simplex_constrain (const T &y, return_type_t< T > &lp) |
| Return the simplex corresponding to the specified free vector. More... | |
| template<typename Vec , require_eigen_col_vector_t< Vec > * = nullptr> | |
| auto | simplex_free (const Vec &x) |
| Return an unconstrained vector that when transformed produces the specified simplex. More... | |
| template<typename T , require_std_vector_t< T > * = nullptr> | |
| auto | simplex_free (const T &x) |
Overload of simplex_free() to untransform each Eigen vector in a standard vector. More... | |
| template<typename T , require_not_container_st< std::is_arithmetic, T > * = nullptr, require_not_var_matrix_t< T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | sin (const T &x) |
| Vectorized version of sin(). More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | sin (const Container &x) |
| Version of sin() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr, require_not_st_var< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, 1 > | singular_values (const EigMat &m) |
| Return the vector of the singular values of the specified matrix in decreasing order of magnitude. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | sinh (const Container &x) |
| Vectorized version of sinh(). More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | sinh (const Container &x) |
| Version of sinh() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename ScalarT , require_stan_scalar_t< ScalarT > * = nullptr> | |
| size_t | size_mvt (const ScalarT &) |
| Provides the size of a multivariate argument. More... | |
| template<typename MatrixT , require_matrix_t< MatrixT > * = nullptr> | |
| size_t | size_mvt (const MatrixT &) |
| template<typename MatrixT , require_matrix_t< MatrixT > * = nullptr> | |
| size_t | size_mvt (const std::vector< MatrixT > &x) |
| template<typename T > | |
| bool | size_zero (const T &x) |
| Returns 1 if input is of length 0, returns 0 otherwise. More... | |
| template<typename T , typename... Ts> | |
| bool | size_zero (const T &x, const Ts &...xs) |
| Returns 1 if any inputs are of length 0, returns 0 otherwise. More... | |
| template<typename ColVec , require_eigen_col_vector_vt< std::is_arithmetic, ColVec > * = nullptr> | |
| plain_type_t< ColVec > | softmax (const ColVec &v) |
| Return the softmax of the specified vector. More... | |
| template<typename T > | |
| std::vector< T > | sort_asc (std::vector< T > xs) |
| Return the specified standard vector in ascending order. More... | |
| template<typename EigVec , require_eigen_vector_t< EigVec > * = nullptr> | |
| plain_type_t< EigVec > | sort_asc (EigVec &&xs) |
| Return the specified vector in ascending order. More... | |
| template<typename T > | |
| std::vector< T > | sort_desc (std::vector< T > xs) |
| Return the specified standard vector in descending order. More... | |
| template<typename EigVec , require_eigen_vector_t< EigVec > * = nullptr> | |
| plain_type_t< EigVec > | sort_desc (EigVec &&xs) |
| Return the specified vector in descending order. More... | |
| template<bool ascending, typename C > | |
| std::vector< int > | sort_indices (const C &xs) |
| Return an integer array of indices of the specified container sorting the values in ascending or descending order based on the value of the first template parameter. More... | |
| template<typename C > | |
| std::vector< int > | sort_indices_asc (const C &xs) |
| Return a sorted copy of the argument container in ascending order. More... | |
| template<typename C > | |
| std::vector< int > | sort_indices_desc (const C &xs) |
| Return a sorted copy of the argument container in ascending order. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr> | |
| auto | sqrt (const Container &x) |
Vectorized version of sqrt(). More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr> | |
| auto | sqrt (const Container &x) |
Version of sqrt() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| double | square (double x) |
| Return the square of the specified argument. More... | |
| template<typename Container , require_not_stan_scalar_t< Container > * = nullptr, require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | square (const Container &x) |
| Vectorized version of square(). More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | square (const Container &x) |
| Version of square() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename Scal1 , typename Scal2 , require_all_stan_scalar_t< Scal1, Scal2 > * = nullptr, require_all_not_var_t< Scal1, Scal2 > * = nullptr> | |
| return_type_t< Scal1, Scal2 > | squared_distance (const Scal1 &x1, const Scal2 &x2) |
| Returns the squared distance. More... | |
| template<typename EigVec1 , typename EigVec2 , require_all_eigen_vector_t< EigVec1, EigVec2 > * = nullptr, require_all_not_eigen_vt< is_var, EigVec1, EigVec2 > * = nullptr> | |
| return_type_t< EigVec1, EigVec2 > | squared_distance (const EigVec1 &v1, const EigVec2 &v2) |
| Returns the squared distance between the specified vectors of the same dimensions. More... | |
| template<typename T , require_not_container_t< T > * = nullptr> | |
| void | stan_print (std::ostream *o, const T &x) |
| template<typename EigVec , require_eigen_vector_t< EigVec > * = nullptr> | |
| void | stan_print (std::ostream *o, const EigVec &x) |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr, require_not_eigen_vector_t< EigMat > * = nullptr> | |
| void | stan_print (std::ostream *o, const EigMat &x) |
| template<typename T > | |
| void | stan_print (std::ostream *o, const std::vector< T > &x) |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| T | step (const T &y) |
| The step, or Heaviside, function. More... | |
| template<typename T , require_container_t< T > * = nullptr> | |
| auto | step (const T &x) |
Return the elementwise application of step() to specified argument container. More... | |
| template<typename T , require_matrix_t< T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | sub_col (const T &m, size_t i, size_t j, size_t nrows) |
| Return a nrows x 1 subcolumn starting at (i-1, j-1). More... | |
| template<typename T , require_matrix_t< T > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | sub_row (const T &m, size_t i, size_t j, size_t ncols) |
| Return a 1 x ncols subrow starting at (i-1, j-1). More... | |
| template<typename ScalarA , typename ScalarB , require_all_stan_scalar_t< ScalarA, ScalarB > * = nullptr, require_all_not_var_t< ScalarA, ScalarB > * = nullptr> | |
| return_type_t< ScalarA, ScalarB > | subtract (const ScalarA &a, const ScalarB &b) |
| Return the result of subtracting the second scalar from the first scalar. More... | |
| template<typename Mat1 , typename Mat2 , require_all_eigen_t< Mat1, Mat2 > * = nullptr, require_all_not_st_var< Mat1, Mat2 > * = nullptr> | |
| auto | subtract (const Mat1 &m1, const Mat2 &m2) |
| Return the result of subtracting the second specified matrix from the first specified matrix. More... | |
| template<typename Scal , typename Mat , require_stan_scalar_t< Scal > * = nullptr, require_eigen_t< Mat > * = nullptr, require_all_not_st_var< Mat, Scal > * = nullptr> | |
| auto | subtract (const Scal c, const Mat &m) |
| Return the result of subtracting the specified matrix from the specified scalar. More... | |
| template<typename Mat , typename Scal , require_eigen_t< Mat > * = nullptr, require_stan_scalar_t< Scal > * = nullptr, require_all_not_st_var< Scal, Mat > * = nullptr> | |
| auto | subtract (const Mat &m, const Scal c) |
| Return the result of subtracting the specified scalar from the specified matrix. More... | |
| template<typename T , require_stan_scalar_t< T > * = nullptr> | |
| T | sum (T &&m) |
| Returns specified input value. More... | |
| template<typename T , require_not_var_t< T > * = nullptr> | |
| T | sum (const std::vector< T > &m) |
| Return the sum of the values in the specified standard vector. More... | |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr, require_not_st_var< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | svd_U (const EigMat &m) |
Given input matrix m, return matrix U where m = UDV^{T} More... | |
| template<typename EigMat , require_eigen_matrix_dynamic_t< EigMat > * = nullptr, require_not_st_var< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | svd_V (const EigMat &m) |
Given input matrix m, return matrix V where m = UDV^{T} More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | symmetrize_from_lower_tri (const T &m) |
| Return a symmetric matrix using elements from the lower triangular part of the input matrix. More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, Eigen::Dynamic, Eigen::Dynamic > | symmetrize_from_upper_tri (const T &m) |
| Return a symmetric matrix using elements from the upper triangular part of the input matrix. More... | |
| template<typename T , require_vector_t< T > * = nullptr> | |
| auto | tail (const T &v, size_t n) |
| Return the specified number of elements as a vector or row vector (same as input) from the back of the specified vector or row vector. More... | |
| template<typename T > | |
| std::vector< T > | tail (const std::vector< T > &sv, size_t n) |
| Return the specified number of elements as a standard vector from the back of the specified standard vector. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | tan (const Container &x) |
Vectorized version of tan(). More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | tan (const Container &x) |
Version of tan() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename Container , require_not_container_st< std::is_arithmetic, Container > * = nullptr, require_not_var_matrix_t< Container > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< Container > * = nullptr> | |
| auto | tanh (const Container &x) |
Vectorized version of tanh(). More... | |
| template<typename Container , require_container_st< std::is_arithmetic, Container > * = nullptr> | |
| auto | tanh (const Container &x) |
Version of tanh() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these. More... | |
| template<typename T , require_eigen_vt< std::is_arithmetic, T > * = nullptr> | |
| Eigen::Matrix< value_type_t< T >, T::RowsAtCompileTime, T::RowsAtCompileTime > | tcrossprod (const T &M) |
| Returns the result of post-multiplying a matrix by its own transpose. More... | |
| double | tgamma (double x) |
| Return the gamma function applied to the specified argument. More... | |
| template<typename T , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| auto | tgamma (const T &x) |
| Vectorized version of tgamma(). More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| std::vector< value_type_t< EigMat > > | to_array_1d (const EigMat &matrix) |
| template<typename T > | |
| std::vector< T > | to_array_1d (const std::vector< T > &x) |
| template<typename T > | |
| std::vector< typename scalar_type< T >::type > | to_array_1d (const std::vector< std::vector< T >> &x) |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| std::vector< std::vector< value_type_t< EigMat > > > | to_array_2d (const EigMat &matrix) |
| template<typename T = double, typename S = double> | |
| constexpr std::complex< stan::real_return_t< T, S > > | to_complex (const T &re=0, const S &im=0) |
| Return a complex value from a real component and an imaginary component. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| EigMat | to_matrix (EigMat &&x) |
| Returns a matrix with dynamic dimensions constructed from an Eigen matrix which is either a row vector, column vector, or matrix. More... | |
| template<typename T > | |
| Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | to_matrix (const std::vector< Eigen::Matrix< T, 1, Eigen::Dynamic >> &x) |
| Returns a matrix representation of a standard vector of Eigen row vectors with the same dimensions and indexing order. More... | |
| template<typename T > | |
| Eigen::Matrix< return_type_t< T, double >, Eigen::Dynamic, Eigen::Dynamic > | to_matrix (const std::vector< std::vector< T >> &x) |
| Returns a matrix representation of the standard vector of standard vectors with the same dimensions and indexing order. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | to_matrix (EigMat &&x, int m, int n) |
| Returns a matrix representation of the vector in column-major order with the specified number of rows and columns. More... | |
| template<typename T > | |
| auto | to_matrix (const std::vector< T > &x, int m, int n) |
| Returns a matrix representation of the vector in column-major order with the specified number of rows and columns. More... | |
| Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > | to_matrix (const std::vector< int > &x, int m, int n) |
| Returns a matrix representation of the vector in column-major order with the specified number of rows and columns. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, Eigen::Dynamic > | to_matrix (EigMat &&x, int m, int n, bool col_major) |
| Returns a matrix representation of the vector in column-major order with the specified number of rows and columns. More... | |
| template<typename T > | |
| Eigen::Matrix< return_type_t< T, double >, Eigen::Dynamic, Eigen::Dynamic > | to_matrix (const std::vector< T > &x, int m, int n, bool col_major) |
| Returns a matrix representation of the vector in column-major order with the specified number of rows and columns. More... | |
| template<typename T > | |
| ref_type_t< T && > | to_ref (T &&a) |
| This evaluates expensive Eigen expressions. More... | |
| template<bool Cond, typename T , std::enable_if_t<!Cond > * = nullptr> | |
| T | to_ref_if (T &&a) |
| No-op that should be optimized away. More... | |
| template<bool Cond, typename T , std::enable_if_t< Cond > * = nullptr> | |
| ref_type_t< T && > | to_ref_if (T &&a) |
| If the condition is true, evaluates expensive Eigen expressions. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, 1, Eigen::Dynamic > | to_row_vector (const EigMat &matrix) |
| template<typename T > | |
| Eigen::Matrix< T, 1, Eigen::Dynamic > | to_row_vector (const std::vector< T > &vec) |
| Eigen::Matrix< double, 1, Eigen::Dynamic > | to_row_vector (const std::vector< int > &vec) |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| Eigen::Matrix< value_type_t< EigMat >, Eigen::Dynamic, 1 > | to_vector (const EigMat &matrix) |
| template<typename T > | |
| Eigen::Matrix< T, Eigen::Dynamic, 1 > | to_vector (const std::vector< T > &vec) |
| Eigen::Matrix< double, Eigen::Dynamic, 1 > | to_vector (const std::vector< int > &vec) |
| template<typename T , require_eigen_t< T > * = nullptr, require_not_st_var< T > * = nullptr> | |
| value_type_t< T > | trace (const T &m) |
| Returns the trace of the specified matrix. More... | |
| template<typename EigMat1 , typename T2 , typename EigMat3 , require_not_col_vector_t< EigMat1 > * = nullptr, require_all_not_st_var< EigMat1, T2, EigMat3 > * = nullptr> | |
| return_type_t< EigMat1, T2, EigMat3 > | trace_gen_inv_quad_form_ldlt (const EigMat1 &D, LDLT_factor< T2 > &A, const EigMat3 &B) |
| Compute the trace of an inverse quadratic form. More... | |
| template<typename EigVec , typename T , typename EigMat , require_col_vector_t< EigVec > * = nullptr, require_all_not_st_var< EigVec, T, EigMat > * = nullptr> | |
| return_type_t< EigVec, T, EigMat > | trace_gen_inv_quad_form_ldlt (const EigVec &D, LDLT_factor< T > &A, const EigMat &B) |
| Compute the trace of an inverse quadratic form. More... | |
| template<typename TD , typename TA , typename TB , typename = require_all_eigen_t<TD, TA, TB>, typename = require_all_not_vt_var<TD, TA, TB>, typename = require_any_not_vt_arithmetic<TD, TA, TB>> | |
| auto | trace_gen_quad_form (const TD &D, const TA &A, const TB &B) |
| Return the trace of D times the quadratic form of B and A. More... | |
| template<typename EigMatD , typename EigMatA , typename EigMatB , require_all_eigen_vt< std::is_arithmetic, EigMatD, EigMatA, EigMatB > * = nullptr> | |
| double | trace_gen_quad_form (const EigMatD &D, const EigMatA &A, const EigMatB &B) |
| Return the trace of D times the quadratic form of B and A. More... | |
| template<typename T , typename EigMat2 , typename = require_all_not_st_var<T, EigMat2>> | |
| return_type_t< T, EigMat2 > | trace_inv_quad_form_ldlt (LDLT_factor< T > &A, const EigMat2 &B) |
| Compute the trace of an inverse quadratic form. More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_vt< std::is_arithmetic, EigMat1, EigMat2 > * = nullptr> | |
| return_type_t< EigMat1, EigMat2 > | trace_quad_form (const EigMat1 &A, const EigMat2 &B) |
| Compute trace(B^T A B). More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| auto | transpose (const T &m) |
| Transposes a matrix. More... | |
| template<typename T > | |
| T | trigamma_impl (const T &x) |
| Return the trigamma function applied to the argument. More... | |
| double | trigamma (double u) |
| Return the second derivative of the log Gamma function evaluated at the specified argument. More... | |
| double | trigamma (int u) |
| Return the second derivative of the log Gamma function evaluated at the specified argument. More... | |
| template<typename T , require_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | trigamma (const T &x) |
Return the elementwise application of trigamma() to specified argument container. More... | |
| template<typename T , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T > * = nullptr> | |
| auto | trunc (const T &x) |
Return the elementwise application of trunc() to specified argument container. More... | |
| template<typename T , typename U , require_all_stan_scalar_t< T, U > * = nullptr, require_all_not_st_var< T, U > * = nullptr> | |
| auto | ub_constrain (const T &x, const U &ub) |
| Return the upper-bounded value for the specified unconstrained matrix and upper bound. More... | |
| template<typename T , typename U , require_all_stan_scalar_t< T, U > * = nullptr, require_all_not_st_var< T, U > * = nullptr> | |
| auto | ub_constrain (const T &x, const U &ub, std::decay_t< return_type_t< T, U >> &lp) |
| Return the upper-bounded value for the specified unconstrained scalar and upper bound and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More... | |
| template<typename T , typename U , require_eigen_t< T > * = nullptr, require_stan_scalar_t< U > * = nullptr, require_all_not_st_var< T, U > * = nullptr> | |
| auto | ub_constrain (const T &x, const U &ub) |
Specialization of ub_constrain to apply a scalar upper bound elementwise to each input. More... | |
| template<typename T , typename U , require_eigen_t< T > * = nullptr, require_stan_scalar_t< U > * = nullptr, require_all_not_st_var< T, U > * = nullptr> | |
| auto | ub_constrain (const T &x, const U &ub, std::decay_t< return_type_t< T, U >> &lp) |
Specialization of ub_constrain to apply a scalar upper bound elementwise to each input. More... | |
| template<typename T , typename U , require_not_std_vector_t< U > * = nullptr> | |
| auto | ub_constrain (const std::vector< T > &x, const U &ub) |
Specialization of ub_constrain to apply a scalar upper bound elementwise to each input element. More... | |
| template<typename T , typename U , require_not_std_vector_t< U > * = nullptr> | |
| auto | ub_constrain (const std::vector< T > &x, const U &ub, return_type_t< T, U > &lp) |
Specialization of ub_constrain to apply a scalar upper bound elementwise to each input element. More... | |
| template<typename T , typename U > | |
| auto | ub_constrain (const std::vector< T > &x, const std::vector< U > &ub) |
Specialization of ub_constrain to apply a container of upper bounds elementwise to each input element. More... | |
| template<typename T , typename U > | |
| auto | ub_constrain (const std::vector< T > &x, const std::vector< U > &ub, return_type_t< T, U > &lp) |
Specialization of ub_constrain to apply a container of upper bounds elementwise to each input element. More... | |
| template<bool Jacobian, typename T , typename U > | |
| auto | ub_constrain (const T &x, const U &ub, return_type_t< T, U > &lp) |
Specialization of ub_constrain to apply a container of upper bounds elementwise to each input element. More... | |
| template<typename T , typename U , require_not_std_vector_t< T > * = nullptr, require_stan_scalar_t< U > * = nullptr> | |
| auto | ub_free (T &&y, U &&ub) |
| Return the free scalar that corresponds to the specified upper-bounded value with respect to the specified upper bound. More... | |
| template<typename T , typename U , require_all_eigen_t< T, U > * = nullptr> | |
| auto | ub_free (T &&y, U &&ub) |
| Return the free matrix that corresponds to the specified upper-bounded matrix with respect to the specified upper bound. More... | |
| template<typename T , typename U , require_not_std_vector_t< U > * = nullptr> | |
| auto | ub_free (const std::vector< T > y, const U &ub) |
| Return the free variable that corresponds to the specified upper-bounded variable with respect to the specified upper bound. More... | |
| template<typename T , typename U > | |
| auto | ub_free (const std::vector< T > y, const std::vector< U > &ub) |
| Return the free variable that corresponds to the specified upper-bounded variable with respect to the specified upper bound. More... | |
| auto | uniform_simplex (int K) |
| Return a uniform simplex of size K. More... | |
| template<typename T , require_eigen_col_vector_t< T > * = nullptr, require_not_vt_autodiff< T > * = nullptr> | |
| plain_type_t< T > | unit_vector_constrain (const T &y) |
| Return the unit length vector corresponding to the free vector y. More... | |
| template<typename T1 , typename T2 , require_eigen_col_vector_t< T1 > * = nullptr, require_all_not_vt_autodiff< T1, T2 > * = nullptr> | |
| plain_type_t< T1 > | unit_vector_constrain (const T1 &y, T2 &lp) |
| Return the unit length vector corresponding to the free vector y. More... | |
| template<bool Jacobian, typename T , require_not_std_vector_t< T > * = nullptr> | |
| auto | unit_vector_constrain (const T &y, return_type_t< T > &lp) |
| Return the unit length vector corresponding to the free vector y. More... | |
| template<typename EigVec , require_eigen_col_vector_t< EigVec > * = nullptr> | |
| auto | unit_vector_free (EigVec &&x) |
| Transformation of a unit length vector to a "free" vector However, we are just fixing the unidentified radius to 1. More... | |
| template<typename T , require_std_vector_t< T > * = nullptr> | |
| auto | unit_vector_free (const T &x) |
Overload of unit_vector_free() to untransform each Eigen vector in a standard vector. More... | |
| std::vector< int > | unitspaced_array (int low, int high) |
| Return an array of integers in an ordered sequence. More... | |
| template<typename T , require_st_arithmetic< T > * = nullptr> | |
| T | value_of (T &&x) |
| Inputs that are arithmetic types or containers of airthmetric types are returned from value_of unchanged. More... | |
| template<typename T , require_complex_t< T > * = nullptr, require_t< std::is_arithmetic< typename std::decay_t< T >::value_type >> * = nullptr> | |
| auto | value_of (T &&x) |
| template<typename T , require_std_vector_t< T > * = nullptr, require_not_st_arithmetic< T > * = nullptr> | |
| auto | value_of (const T &x) |
| For std::vectors of non-arithmetic types, return a std::vector composed of value_of applied to each element. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr, require_not_st_arithmetic< EigMat > * = nullptr> | |
| auto | value_of (EigMat &&M) |
| For Eigen matrices and expressions of non-arithmetic types, return an expression that represents the Eigen::Matrix resulting from applying value_of elementwise. More... | |
| template<typename T , typename = require_stan_scalar_t<T>> | |
| double | value_of_rec (const T x) |
| Return the value of the specified scalar argument converted to a double value. More... | |
| double | value_of_rec (double x) |
| Return the specified argument. More... | |
| template<typename T > | |
| std::complex< double > | value_of_rec (const std::complex< T > &x) |
| Recursively apply value-of to the parts of the argument. More... | |
| template<typename T , require_not_same_t< double, T > * = nullptr> | |
| std::vector< double > | value_of_rec (const std::vector< T > &x) |
| Convert a std::vector of type T to a std::vector of doubles. More... | |
| template<typename T , require_std_vector_t< T > * = nullptr, require_vt_same< double, T > * = nullptr> | |
| T | value_of_rec (T &&x) |
| Return the specified argument. More... | |
| template<typename T , typename = require_not_st_same<T, double>, typename = require_eigen_t<T>> | |
| auto | value_of_rec (T &&M) |
| Convert a matrix of type T to a matrix of doubles. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr, require_not_vt_var< EigMat > * = nullptr> | |
| value_type_t< EigMat > | variance (const EigMat &m) |
| Returns the sample variance (divide by length - 1) of the coefficients in the specified matrix. More... | |
| template<typename StdVec , require_std_vector_t< StdVec > * = nullptr, require_not_vt_var< StdVec > * = nullptr> | |
| value_type_t< StdVec > | variance (const StdVec &v) |
| Returns the sample variance (divide by length - 1) of the coefficients in the specified standard vector. More... | |
| template<typename Vec , typename... Args> | |
| auto | vec_concat (const Vec &v1, const Args &...args) |
| Get the event stack from a vector of events and other arguments. More... | |
| std::vector< double > | zeros_array (int K) |
| Return an array of zeros. More... | |
| std::vector< int > | zeros_int_array (int K) |
| Return an integer array of zeros. More... | |
| auto | zeros_row_vector (int K) |
| Return a row vector of zeros. More... | |
| auto | zeros_vector (int K) |
| Return a vector of zeros. More... | |
| template<class F , class Tuple > | |
| decltype(auto) constexpr | apply (F &&f, Tuple &&t) |
| template<typename T1 , typename T2 , typename F , require_all_stan_scalar_t< T1, T2 > * = nullptr> | |
| auto | apply_scalar_binary (const T1 &x, const T2 &y, const F &f) |
| Base template function for vectorization of binary scalar functions defined by applying a functor to a combination of scalars, containers of matching sizes, or a combination of a scalar and a container. More... | |
| template<typename T1 , typename T2 , typename F , require_eigen_vector_vt< is_stan_scalar, T1 > * = nullptr, require_std_vector_vt< std::is_integral, T2 > * = nullptr> | |
| auto | apply_scalar_binary (const T1 &x, const T2 &y, const F &f) |
| Specialisation for use with one Eigen vector (row or column) and a one-dimensional std::vector of integer types. More... | |
| template<typename T1 , typename T2 , typename F , require_eigen_matrix_dynamic_vt< is_stan_scalar, T1 > * = nullptr, require_std_vector_vt< is_std_vector, T2 > * = nullptr, require_std_vector_st< std::is_integral, T2 > * = nullptr> | |
| auto | apply_scalar_binary (const T1 &x, const T2 &y, const F &f) |
| Specialisation for use with one Eigen matrix and a two-dimensional std::vector of integer types. More... | |
| template<typename F > | |
| void | finite_diff_gradient (const F &f, const Eigen::VectorXd &x, double &fx, Eigen::VectorXd &grad_fx, double epsilon=1e-03) |
| Calculate the value and the gradient of the specified function at the specified argument using finite difference. More... | |
| template<typename F > | |
| void | finite_diff_gradient_auto (const F &f, const Eigen::VectorXd &x, double &fx, Eigen::VectorXd &grad_fx) |
| Calculate the value and the gradient of the specified function at the specified argument using finite difference. More... | |
| template<typename F , typename T > | |
| constexpr auto | for_each (F &&f, T &&t) |
| Apply a function to each element of a tuple. More... | |
| template<typename F , typename T1 , typename T2 > | |
| constexpr auto | for_each (F &&f, T1 &&t1, T2 &&t2) |
| Apply a function to each element of two tuples. More... | |
| template<typename F , typename T1 , typename T2 , typename T3 > | |
| constexpr auto | for_each (F &&f, T1 &&t1, T2 &&t2, T3 &&t3) |
| Apply a function to each element of three tuples. More... | |
| template<typename F > | |
| double | integrate (const F &f, double a, double b, double relative_tolerance) |
| Integrate a single variable function f from a to b to within a specified relative tolerance. More... | |
| template<typename F , typename... Args, require_all_not_st_var< Args... > * = nullptr> | |
| double | integrate_1d_impl (const F &f, double a, double b, double relative_tolerance, std::ostream *msgs, const Args &...args) |
| Compute the integral of the single variable function f from a to b to within a specified relative tolerance. More... | |
| template<typename F > | |
| double | integrate_1d (const F &f, double a, double b, const std::vector< double > &theta, const std::vector< double > &x_r, const std::vector< int > &x_i, std::ostream *msgs, const double relative_tolerance=std::sqrt(EPSILON)) |
| Compute the integral of the single variable function f from a to b to within a specified relative tolerance. More... | |
| template<typename F , typename T_y0 , typename T_param , typename T_t0 , typename T_ts > | |
| auto | integrate_ode_rk45 (const F &f, const std::vector< T_y0 > &y0, const T_t0 &t0, const std::vector< T_ts > &ts, const std::vector< T_param > &theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs=nullptr, double relative_tolerance=1e-6, double absolute_tolerance=1e-6, int max_num_steps=1e6) |
| template<int call_id, typename F , typename T_shared_param , typename T_job_param , require_eigen_col_vector_t< T_shared_param > * = nullptr> | |
| Eigen::Matrix< return_type_t< T_shared_param, T_job_param >, Eigen::Dynamic, 1 > | map_rect (const T_shared_param &shared_params, const std::vector< Eigen::Matrix< T_job_param, Eigen::Dynamic, 1 >> &job_params, const std::vector< std::vector< double >> &x_r, const std::vector< std::vector< int >> &x_i, std::ostream *msgs=nullptr) |
| Map N function evaluations to parameters and data which are in rectangular format. More... | |
| std::vector< int > | mpi_map_chunks (std::size_t num_jobs, std::size_t chunk_size=1) |
| Maps jobs of given chunk size to workers and returning a vector of counts. More... | |
| template<typename T > | |
| std::unique_lock< std::mutex > | mpi_broadcast_command () |
| Broadcasts default constructible commands to the cluster. More... | |
| std::unique_lock< std::mutex > | mpi_broadcast_command (std::shared_ptr< mpi_command > &command) |
| Broadcasts a command instance to the listening cluster. More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... Args, require_eigen_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, Args... >, Eigen::Dynamic, 1 > > | ode_ckrk_tol_impl (const char *function_name, const F &f, const T_y0 &y0_arg, T_t0 t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... Args, require_eigen_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, Args... >, Eigen::Dynamic, 1 > > | ode_ckrk_tol (const F &f, const T_y0 &y0_arg, T_t0 t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... Args, require_eigen_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, Args... >, Eigen::Dynamic, 1 > > | ode_ckrk (const F &f, const T_y0 &y0, T_t0 t0, const std::vector< T_ts > &ts, std::ostream *msgs, const Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... Args, require_eigen_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, Args... >, Eigen::Dynamic, 1 > > | ode_rk45_tol_impl (const char *function_name, const F &f, const T_y0 &y0_arg, T_t0 t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... Args, require_eigen_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, Args... >, Eigen::Dynamic, 1 > > | ode_rk45_tol (const F &f, const T_y0 &y0_arg, T_t0 t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... Args, require_eigen_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, Args... >, Eigen::Dynamic, 1 > > | ode_rk45 (const F &f, const T_y0 &y0, T_t0 t0, const std::vector< T_ts > &ts, std::ostream *msgs, const Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0_t0 , typename T_t0 , typename T_t , typename... Args, typename = require_all_arithmetic_t<T_y0_t0, T_t0, T_t, scalar_type_t<Args>...>> | |
| Eigen::VectorXd | ode_store_sensitivities (const F &f, const std::vector< double > &coupled_state, const Eigen::Matrix< T_y0_t0, Eigen::Dynamic, 1 > &y0, T_t0 t0, T_t t, std::ostream *msgs, const Args &...args) |
| When all arguments are arithmetic, there are no sensitivities to store, so the function just returns the current coupled_state. More... | |
| template<typename ReduceFunction , typename Vec , typename = require_vector_like_t<Vec>, typename... Args> | |
| auto | reduce_sum (Vec &&vmapped, int grainsize, std::ostream *msgs, Args &&...args) |
Call an instance of the function ReduceFunction on every element of an input sequence and sum these terms. More... | |
| template<typename ReduceFunction , typename Vec , typename = require_vector_like_t<Vec>, typename... Args> | |
| auto | reduce_sum_static (Vec &&vmapped, int grainsize, std::ostream *msgs, Args &&...args) |
Call an instance of the function ReduceFunction on every element of an input sequence and sum these terms. More... | |
| template<typename T_desired , typename T_actual , typename = std::enable_if_t<std::is_same<std::decay_t<T_actual>, std::decay_t<T_desired>>::value && !is_eigen<T_desired>::value>> | |
| T_actual && | forward_as (T_actual &&a) |
| Assume which type we get. More... | |
| template<typename T_desired , typename T_actual , typename = std::enable_if_t< !std::is_same<std::decay<T_actual>, std::decay<T_desired>>::value && (!is_eigen<T_desired>::value || !is_eigen<T_actual>::value)>> | |
| T_desired | forward_as (const T_actual &a) |
| Assume which type we get. More... | |
| template<typename T_desired , typename T_actual , require_eigen_t< T_desired > * = nullptr, std::enable_if_t< std::is_same< value_type_t< T_actual >, value_type_t< T_desired >>::value &&is_eigen< T_desired >::value &&is_eigen< T_actual >::value &&internal::eigen_static_size_match(T_desired::RowsAtCompileTime, std::decay_t< T_actual >::RowsAtCompileTime)&&internal::eigen_static_size_match(T_desired::ColsAtCompileTime, std::decay_t< T_actual >::ColsAtCompileTime)> * = nullptr> | |
| T_actual && | forward_as (T_actual &&a) |
| Assume which type we get. More... | |
| template<typename T_desired , typename T_actual , require_all_eigen_t< T_desired, T_actual > * = nullptr, std::enable_if_t< !std::is_same< value_type_t< T_actual >, value_type_t< T_desired >>::value||!internal::eigen_static_size_match(T_desired::RowsAtCompileTime, std::decay_t< T_actual >::RowsAtCompileTime)||!internal::eigen_static_size_match(T_desired::ColsAtCompileTime, std::decay_t< T_actual >::ColsAtCompileTime)> * = nullptr> | |
| T_desired | forward_as (const T_actual &a) |
| Assume which type we get. More... | |
| template<typename T , typename... Ptrs, std::enable_if_t< sizeof...(Ptrs) > = 1> | |
| Ptrs | holder (T &&arg, Ptrs *...pointers) |
| template<typename T > | |
| T | holder (T &&arg) |
| template<typename F , typename... Args, require_not_plain_type_t< decltype(std::declval< F >()(std::declval< Args & >()...))> * = nullptr> | |
| auto | make_holder (const F &func, Args &&...args) |
| Constructs an expression from given arguments using given functor. More... | |
| template<std::size_t N, class F > | |
| constexpr auto | index_apply (F f) |
| Calls given callable with an index sequence. More... | |
| template<bool Condition, typename T1 , typename T2 , std::enable_if_t< Condition > * = nullptr> | |
| T1 | static_select (T1 &&a, T2 &&b) |
| Returns one of the arguments that can be of different type, depending on the compile time condition. More... | |
| template<bool Condition, typename T1 , typename T2 , std::enable_if_t<!Condition > * = nullptr> | |
| T2 | static_select (T1 &&a, T2 &&b) |
| template<typename T_n , typename T_prob > | |
| return_type_t< T_prob > | bernoulli_ccdf_log (const T_n &n, const T_prob &theta) |
| template<typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr> | |
| return_type_t< T_prob > | bernoulli_cdf (const T_n &n, const T_prob &theta) |
| Returns the CDF of the Bernoulli distribution. More... | |
| template<typename T_n , typename T_prob > | |
| return_type_t< T_prob > | bernoulli_cdf_log (const T_n &n, const T_prob &theta) |
| template<typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr> | |
| return_type_t< T_prob > | bernoulli_lccdf (const T_n &n, const T_prob &theta) |
| Returns the log CCDF of the Bernoulli distribution. More... | |
| template<typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr> | |
| return_type_t< T_prob > | bernoulli_lcdf (const T_n &n, const T_prob &theta) |
| Returns the log CDF of the Bernoulli distribution. More... | |
| template<bool propto, typename T_n , typename T_prob > | |
| return_type_t< T_prob > | bernoulli_log (const T_n &n, const T_prob &theta) |
| template<typename T_y , typename T_prob > | |
| return_type_t< T_prob > | bernoulli_log (const T_y &n, const T_prob &theta) |
| template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta > | |
| return_type_t< T_x, T_alpha, T_beta > | bernoulli_logit_glm_log (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| template<typename T_y , typename T_x , typename T_alpha , typename T_beta > | |
| return_type_t< T_x, T_alpha, T_beta > | bernoulli_logit_glm_log (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , require_eigen_t< T_x > * = nullptr> | |
| return_type_t< T_x, T_alpha, T_beta > | bernoulli_logit_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| Returns the log PMF of the Generalized Linear Model (GLM) with Bernoulli distribution and logit link function. More... | |
| template<typename T_y , typename T_x , typename T_alpha , typename T_beta > | |
| return_type_t< T_x, T_beta, T_alpha > | bernoulli_logit_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| template<typename T_x , typename T_alpha , typename T_beta , class RNG > | |
| VectorBuilder< true, int, T_alpha >::type | bernoulli_logit_glm_rng (const T_x &x, const T_alpha &alpha, const T_beta &beta, RNG &rng) |
| Returns a draw from the Generalized Linear Model (GLM) with Bernoulli distribution and logit link function. More... | |
| template<bool propto, typename T_n , typename T_prob > | |
| return_type_t< T_prob > | bernoulli_logit_log (const T_n &n, const T_prob &theta) |
| template<typename T_n , typename T_prob > | |
| return_type_t< T_prob > | bernoulli_logit_log (const T_n &n, const T_prob &theta) |
| template<bool propto, typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr> | |
| return_type_t< T_prob > | bernoulli_logit_lpmf (const T_n &n, const T_prob &theta) |
| Returns the log PMF of the logit-parametrized Bernoulli distribution. More... | |
| template<typename T_n , typename T_prob > | |
| return_type_t< T_prob > | bernoulli_logit_lpmf (const T_n &n, const T_prob &theta) |
| template<typename T_t , class RNG > | |
| VectorBuilder< true, int, T_t >::type | bernoulli_logit_rng (const T_t &t, RNG &rng) |
| Return a Bernoulli random variate with logit-parameterized chance of success using the specified random number generator. More... | |
| template<bool propto, typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr> | |
| return_type_t< T_prob > | bernoulli_lpmf (const T_n &n, const T_prob &theta) |
| Returns the log PMF of the Bernoulli distribution. More... | |
| template<typename T_y , typename T_prob > | |
| return_type_t< T_prob > | bernoulli_lpmf (const T_y &n, const T_prob &theta) |
| template<typename T_theta , class RNG > | |
| VectorBuilder< true, int, T_theta >::type | bernoulli_rng (const T_theta &theta, RNG &rng) |
| Return a Bernoulli random variate with specified chance of success parameter using the specified random number generator. More... | |
| template<typename T_n , typename T_N , typename T_size1 , typename T_size2 > | |
| return_type_t< T_size1, T_size2 > | beta_binomial_ccdf_log (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta) |
| template<typename T_n , typename T_N , typename T_size1 , typename T_size2 > | |
| return_type_t< T_size1, T_size2 > | beta_binomial_cdf (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta) |
| Returns the CDF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters. More... | |
| template<typename T_n , typename T_N , typename T_size1 , typename T_size2 > | |
| return_type_t< T_size1, T_size2 > | beta_binomial_cdf_log (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta) |
| template<typename T_n , typename T_N , typename T_size1 , typename T_size2 > | |
| return_type_t< T_size1, T_size2 > | beta_binomial_lccdf (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta) |
| Returns the log CCDF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters. More... | |
| template<typename T_n , typename T_N , typename T_size1 , typename T_size2 > | |
| return_type_t< T_size1, T_size2 > | beta_binomial_lcdf (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta) |
| Returns the log CDF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters. More... | |
| template<bool propto, typename T_n , typename T_N , typename T_size1 , typename T_size2 > | |
| return_type_t< T_size1, T_size2 > | beta_binomial_log (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta) |
| template<typename T_n , typename T_N , typename T_size1 , typename T_size2 > | |
| return_type_t< T_size1, T_size2 > | beta_binomial_log (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta) |
| template<bool propto, typename T_n , typename T_N , typename T_size1 , typename T_size2 , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_N, T_size1, T_size2 > * = nullptr> | |
| return_type_t< T_size1, T_size2 > | beta_binomial_lpmf (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta) |
| Returns the log PMF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters. More... | |
| template<typename T_n , typename T_N , typename T_size1 , typename T_size2 > | |
| return_type_t< T_size1, T_size2 > | beta_binomial_lpmf (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta) |
| template<typename T_N , typename T_shape1 , typename T_shape2 , class RNG > | |
| VectorBuilder< true, int, T_N, T_shape1, T_shape2 >::type | beta_binomial_rng (const T_N &N, const T_shape1 &alpha, const T_shape2 &beta, RNG &rng) |
| Return a beta-binomial random variate with the specified population size, success, and failure parameters using the given random number generator. More... | |
| template<typename T_y , typename T_scale_succ , typename T_scale_fail > | |
| return_type_t< T_y, T_scale_succ, T_scale_fail > | beta_ccdf_log (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta) |
| template<typename T_y , typename T_scale_succ , typename T_scale_fail > | |
| return_type_t< T_y, T_scale_succ, T_scale_fail > | beta_cdf (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta) |
| Calculates the beta cumulative distribution function for the given variate and scale variables. More... | |
| template<typename T_y , typename T_scale_succ , typename T_scale_fail > | |
| return_type_t< T_y, T_scale_succ, T_scale_fail > | beta_cdf_log (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta) |
| template<typename T_y , typename T_scale_succ , typename T_scale_fail > | |
| return_type_t< T_y, T_scale_succ, T_scale_fail > | beta_lccdf (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta_param) |
| Returns the beta log complementary cumulative distribution function for the given probability, success, and failure parameters. More... | |
| template<typename T_y , typename T_scale_succ , typename T_scale_fail > | |
| return_type_t< T_y, T_scale_succ, T_scale_fail > | beta_lcdf (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta_param) |
| Returns the beta log cumulative distribution function for the given probability, success, and failure parameters. More... | |
| template<bool propto, typename T_y , typename T_scale_succ , typename T_scale_fail > | |
| return_type_t< T_y, T_scale_succ, T_scale_fail > | beta_log (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta) |
| template<typename T_y , typename T_scale_succ , typename T_scale_fail > | |
| return_type_t< T_y, T_scale_succ, T_scale_fail > | beta_log (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta) |
| template<bool propto, typename T_y , typename T_scale_succ , typename T_scale_fail , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale_succ, T_scale_fail > * = nullptr> | |
| return_type_t< T_y, T_scale_succ, T_scale_fail > | beta_lpdf (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta) |
| The log of the beta density for the specified scalar(s) given the specified sample stan::math::size(s). More... | |
| template<typename T_y , typename T_scale_succ , typename T_scale_fail > | |
| return_type_t< T_y, T_scale_succ, T_scale_fail > | beta_lpdf (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta) |
| template<typename T_y , typename T_loc , typename T_prec > | |
| return_type_t< T_y, T_loc, T_prec > | beta_proportion_ccdf_log (const T_y &y, const T_loc &mu, const T_prec &kappa) |
| template<typename T_y , typename T_loc , typename T_prec > | |
| return_type_t< T_y, T_loc, T_prec > | beta_proportion_cdf_log (const T_y &y, const T_loc &mu, const T_prec &kappa) |
| template<typename T_y , typename T_loc , typename T_prec > | |
| return_type_t< T_y, T_loc, T_prec > | beta_proportion_lccdf (const T_y &y, const T_loc &mu, const T_prec &kappa) |
| Returns the beta log complementary cumulative distribution function for specified probability, location, and precision parameters: beta_proportion_lccdf(y | mu, kappa) = beta_lccdf(y | mu * kappa, (1 - mu) * kappa). More... | |
| template<typename T_y , typename T_loc , typename T_prec > | |
| return_type_t< T_y, T_loc, T_prec > | beta_proportion_lcdf (const T_y &y, const T_loc &mu, const T_prec &kappa) |
| Returns the beta log cumulative distribution function for specified probability, location, and precision parameters: beta_proportion_lcdf(y | mu, kappa) = beta_lcdf(y | mu * kappa, (1 - mu) * kappa). More... | |
| template<bool propto, typename T_y , typename T_loc , typename T_prec > | |
| return_type_t< T_y, T_loc, T_prec > | beta_proportion_log (const T_y &y, const T_loc &mu, const T_prec &kappa) |
| template<typename T_y , typename T_loc , typename T_prec > | |
| return_type_t< T_y, T_loc, T_prec > | beta_proportion_log (const T_y &y, const T_loc &mu, const T_prec &kappa) |
| template<bool propto, typename T_y , typename T_loc , typename T_prec , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_prec > * = nullptr> | |
| return_type_t< T_y, T_loc, T_prec > | beta_proportion_lpdf (const T_y &y, const T_loc &mu, const T_prec &kappa) |
| The log of the beta density for specified y, location, and precision: beta_proportion_lpdf(y | mu, kappa) = beta_lpdf(y | mu * kappa, (1 - mu) * kappa). More... | |
| template<typename T_y , typename T_loc , typename T_prec > | |
| return_type_t< T_y, T_loc, T_prec > | beta_proportion_lpdf (const T_y &y, const T_loc &mu, const T_prec &kappa) |
| template<typename T_loc , typename T_prec , class RNG > | |
| VectorBuilder< true, double, T_loc, T_prec >::type | beta_proportion_rng (const T_loc &mu, const T_prec &kappa, RNG &rng) |
| Return a Beta random variate specified probability, location, and precision parameters: beta_proportion_rng(y | mu, kappa) = beta_rng(y | mu * kappa, (1 - mu) * kappa). More... | |
| template<typename T_shape1 , typename T_shape2 , class RNG > | |
| VectorBuilder< true, double, T_shape1, T_shape2 >::type | beta_rng (const T_shape1 &alpha, const T_shape2 &beta, RNG &rng) |
| Return a Beta random variate with the supplied success and failure parameters using the given random number generator. More... | |
| template<typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_ccdf_log (const T_n &n, const T_N &N, const T_prob &theta) |
| template<typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_cdf (const T_n &n, const T_N &N, const T_prob &theta) |
| Returns the CDF for the binomial distribution evaluated at the specified success, population size, and chance of success. More... | |
| template<typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_cdf_log (const T_n &n, const T_N &N, const T_prob &theta) |
| template<typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_lccdf (const T_n &n, const T_N &N, const T_prob &theta) |
| Returns the log CCDF for the binomial distribution evaluated at the specified success, population size, and chance of success. More... | |
| template<typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_lcdf (const T_n &n, const T_N &N, const T_prob &theta) |
| Returns the log CDF for the binomial distribution evaluated at the specified success, population size, and chance of success. More... | |
| template<bool propto, typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_log (const T_n &n, const T_N &N, const T_prob &theta) |
| template<typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_log (const T_n &n, const T_N &N, const T_prob &theta) |
| template<bool propto, typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_logit_log (const T_n &n, const T_N &N, const T_prob &alpha) |
| template<typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_logit_log (const T_n &n, const T_N &N, const T_prob &alpha) |
| template<bool propto, typename T_n , typename T_N , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_N, T_prob > * = nullptr> | |
| return_type_t< T_prob > | binomial_logit_lpmf (const T_n &n, const T_N &N, const T_prob &alpha) |
| Binomial log PMF in logit parametrization. More... | |
| template<typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_logit_lpmf (const T_n &n, const T_N &N, const T_prob &alpha) |
| template<bool propto, typename T_n , typename T_N , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_N, T_prob > * = nullptr> | |
| return_type_t< T_prob > | binomial_lpmf (const T_n &n, const T_N &N, const T_prob &theta) |
| Returns the log PMF for the binomial distribution evaluated at the specified success, population size, and chance of success. More... | |
| template<typename T_n , typename T_N , typename T_prob > | |
| return_type_t< T_prob > | binomial_lpmf (const T_n &n, const T_N &N, const T_prob &theta) |
| template<typename T_N , typename T_theta , class RNG > | |
| VectorBuilder< true, int, T_N, T_theta >::type | binomial_rng (const T_N &N, const T_theta &theta, RNG &rng) |
| Return a pseudorandom binomial random variable for the given population size and chance of success parameters using the specified random number generator. More... | |
| template<bool propto, typename T_n , typename T_prob > | |
| return_type_t< T_prob > | categorical_log (const T_n &ns, const T_prob &theta) |
| template<typename T_n , typename T_prob > | |
| return_type_t< T_prob > | categorical_log (const T_n &ns, const T_prob &theta) |
| template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , require_eigen_t< T_x > * = nullptr, require_eigen_col_vector_t< T_alpha > * = nullptr, require_eigen_matrix_dynamic_t< T_beta > * = nullptr> | |
| return_type_t< T_x, T_alpha, T_beta > | categorical_logit_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| Returns the log PMF of the Generalized Linear Model (GLM) with categorical distribution and logit (softmax) link function. More... | |
| template<typename T_y , typename T_x , typename T_alpha , typename T_beta > | |
| return_type_t< T_x, T_alpha, T_beta > | categorical_logit_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| template<bool propto, typename T_n , typename T_prob > | |
| return_type_t< T_prob > | categorical_logit_log (const T_n &ns, const T_prob &beta) |
| template<typename T_n , typename T_prob > | |
| return_type_t< T_prob > | categorical_logit_log (const T_n &ns, const T_prob &beta) |
| template<bool propto, typename T_prob , require_eigen_col_vector_t< T_prob > * = nullptr> | |
| return_type_t< T_prob > | categorical_logit_lpmf (int n, const T_prob &beta) |
| template<bool propto, typename T_prob , require_eigen_col_vector_t< T_prob > * = nullptr> | |
| return_type_t< T_prob > | categorical_logit_lpmf (const std::vector< int > &ns, const T_prob &beta) |
| template<typename T_n , typename T_prob , require_st_integral< T_n > * = nullptr, require_eigen_col_vector_t< T_prob > * = nullptr> | |
| return_type_t< T_prob > | categorical_logit_lpmf (const T_n &ns, const T_prob &beta) |
| template<class RNG > | |
| int | categorical_logit_rng (const Eigen::VectorXd &beta, RNG &rng) |
| Return a draw from a Categorical distribution given a a vector of unnormalized log probabilities and a psuedo-random number generator. More... | |
| template<bool propto, typename T_prob , require_eigen_col_vector_t< T_prob > * = nullptr> | |
| return_type_t< T_prob > | categorical_lpmf (int n, const T_prob &theta) |
| template<bool propto, typename T_prob , require_eigen_col_vector_t< T_prob > * = nullptr> | |
| return_type_t< T_prob > | categorical_lpmf (const std::vector< int > &ns, const T_prob &theta) |
| template<typename T_n , typename T_prob , require_st_integral< T_n > * = nullptr, require_eigen_col_vector_t< T_prob > * = nullptr> | |
| return_type_t< T_prob > | categorical_lpmf (const T_n &ns, const T_prob &theta) |
| template<class RNG > | |
| int | categorical_rng (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &theta, RNG &rng) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | cauchy_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | cauchy_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| Returns the cauchy cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | cauchy_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | cauchy_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| Returns the cauchy log complementary cumulative distribution function for the given location, and scale. More... | |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | cauchy_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| Returns the cauchy log cumulative distribution function for the given location, and scale. More... | |
| template<bool propto, typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | cauchy_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s). More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | cauchy_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | cauchy_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s). More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | cauchy_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_loc , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_loc, T_scale >::type | cauchy_rng (const T_loc &mu, const T_scale &sigma, RNG &rng) |
| Return a Cauchy random variate for the given location and scale using the specified random number generator. More... | |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | chi_square_ccdf_log (const T_y &y, const T_dof &nu) |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | chi_square_cdf (const T_y &y, const T_dof &nu) |
| Returns the chi square cumulative distribution function for the given variate and degrees of freedom. More... | |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | chi_square_cdf_log (const T_y &y, const T_dof &nu) |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | chi_square_lccdf (const T_y &y, const T_dof &nu) |
| Returns the chi square log complementary cumulative distribution function for the given variate and degrees of freedom. More... | |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | chi_square_lcdf (const T_y &y, const T_dof &nu) |
| Returns the chi square log cumulative distribution function for the given variate and degrees of freedom. More... | |
| template<bool propto, typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | chi_square_log (const T_y &y, const T_dof &nu) |
| The log of a chi-squared density for y with the specified degrees of freedom parameter. More... | |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | chi_square_log (const T_y &y, const T_dof &nu) |
| template<bool propto, typename T_y , typename T_dof , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof > * = nullptr> | |
| return_type_t< T_y, T_dof > | chi_square_lpdf (const T_y &y, const T_dof &nu) |
| The log of a chi-squared density for y with the specified degrees of freedom parameter. More... | |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | chi_square_lpdf (const T_y &y, const T_dof &nu) |
| template<typename T_deg , class RNG > | |
| VectorBuilder< true, double, T_deg >::type | chi_square_rng (const T_deg &nu, RNG &rng) |
| Return a chi squared random variate with nu degrees of freedom using the specified random number generator. More... | |
| template<bool propto, typename T_prob , typename T_prior_size > | |
| return_type_t< T_prob, T_prior_size > | dirichlet_log (const T_prob &theta, const T_prior_size &alpha) |
| The log of the Dirichlet density for the given theta and a vector of prior sample sizes, alpha. More... | |
| template<typename T_prob , typename T_prior_size > | |
| return_type_t< T_prob, T_prior_size > | dirichlet_log (const T_prob &theta, const T_prior_size &alpha) |
| template<bool propto, typename T_prob , typename T_prior_size , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_prob, T_prior_size > * = nullptr> | |
| return_type_t< T_prob, T_prior_size > | dirichlet_lpdf (const T_prob &theta, const T_prior_size &alpha) |
| The log of the Dirichlet density for the given theta and a vector of prior sample sizes, alpha. More... | |
| template<typename T_prob , typename T_prior_size > | |
| return_type_t< T_prob, T_prior_size > | dirichlet_lpdf (const T_prob &theta, const T_prior_size &alpha) |
| template<bool propto, typename T_prob , typename T_prior_size > | |
| return_type_t< T_prob, T_prior_size > | dirichlet_lpmf (const T_prob &theta, const T_prior_size &alpha) |
| template<typename T_prob , typename T_prior_size > | |
| return_type_t< T_prob, T_prior_size > | dirichlet_lpmf (const T_prob &theta, const T_prior_size &alpha) |
| template<class RNG > | |
| Eigen::VectorXd | dirichlet_rng (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &alpha, RNG &rng) |
| Return a draw from a Dirichlet distribution with specified parameters and pseudo-random number generator. More... | |
| template<typename T_y , typename T_lower , typename T_upper > | |
| double | discrete_range_ccdf_log (const T_y &y, const T_lower &lower, const T_upper &upper) |
| template<typename T_y , typename T_lower , typename T_upper > | |
| double | discrete_range_cdf (const T_y &y, const T_lower &lower, const T_upper &upper) |
| Return the CDF of a discrete range distribution for the given y, lower and upper bounds (all integers). More... | |
| template<typename T_y , typename T_lower , typename T_upper > | |
| double | discrete_range_cdf_log (const T_y &y, const T_lower &lower, const T_upper &upper) |
| template<typename T_y , typename T_lower , typename T_upper > | |
| double | discrete_range_lccdf (const T_y &y, const T_lower &lower, const T_upper &upper) |
| Return the log CCDF of a discrete range distribution for the given y, lower and upper bounds (all integers). More... | |
| template<typename T_y , typename T_lower , typename T_upper > | |
| double | discrete_range_lcdf (const T_y &y, const T_lower &lower, const T_upper &upper) |
| Return the log CDF of a discrete range distribution for the given y, lower and upper bounds (all integers). More... | |
| template<bool propto, typename T_y , typename T_lower , typename T_upper > | |
| double | discrete_range_log (const T_y &y, const T_lower &lower, const T_upper &upper) |
| template<typename T_y , typename T_lower , typename T_upper > | |
| double | discrete_range_log (const T_y &y, const T_lower &lower, const T_upper &upper) |
| template<bool propto, typename T_y , typename T_lower , typename T_upper > | |
| double | discrete_range_lpmf (const T_y &y, const T_lower &lower, const T_upper &upper) |
| Return the log PMF of a discrete range for the given y, lower and upper bound (all integers). More... | |
| template<typename T_y , typename T_lower , typename T_upper > | |
| double | discrete_range_lpmf (const T_y &y, const T_lower &lower, const T_upper &upper) |
| template<typename T_lower , typename T_upper , class RNG > | |
| VectorBuilder< true, int, T_lower, T_upper >::type | discrete_range_rng (const T_lower &lower, const T_upper &upper, RNG &rng) |
| Return an integer random variate between the given lower and upper bounds (inclusive) using the specified random number generator. More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | double_exponential_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | double_exponential_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| Returns the double exponential cumulative density function. More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | double_exponential_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | double_exponential_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| Returns the double exponential log complementary cumulative density function. More... | |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | double_exponential_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| Returns the double exponential log cumulative density function. More... | |
| template<bool propto, typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | double_exponential_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | double_exponential_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | double_exponential_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| Returns the double exponential log probability density function. More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | double_exponential_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_loc , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_loc, T_scale >::type | double_exponential_rng (const T_loc &mu, const T_scale &sigma, RNG &rng) |
| Return a double exponential random variate with the given location and scale using the specified random number generator. More... | |
| template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale > | |
| return_type_t< T_y, T_loc, T_scale, T_inv_scale > | exp_mod_normal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_inv_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_inv_scale > | exp_mod_normal_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale > | |
| return_type_t< T_y, T_loc, T_scale, T_inv_scale > | exp_mod_normal_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_inv_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_inv_scale > | exp_mod_normal_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_inv_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_inv_scale > | exp_mod_normal_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_inv_scale > | |
| return_type_t< T_y, T_loc, T_scale, T_inv_scale > | exp_mod_normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale > | |
| return_type_t< T_y, T_loc, T_scale, T_inv_scale > | exp_mod_normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_inv_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_inv_scale > | exp_mod_normal_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale > | |
| return_type_t< T_y, T_loc, T_scale, T_inv_scale > | exp_mod_normal_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda) |
| template<typename T_loc , typename T_scale , typename T_inv_scale , class RNG > | |
| VectorBuilder< true, double, T_loc, T_scale, T_inv_scale >::type | exp_mod_normal_rng (const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda, RNG &rng) |
| Return an exponentially modified normal random variate for the given location, scale, and inverse scale using the specified random number generator. More... | |
| template<typename T_y , typename T_inv_scale > | |
| return_type_t< T_y, T_inv_scale > | exponential_ccdf_log (const T_y &y, const T_inv_scale &beta) |
| template<typename T_y , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_inv_scale > * = nullptr> | |
| return_type_t< T_y, T_inv_scale > | exponential_cdf (const T_y &y, const T_inv_scale &beta) |
| Calculates the exponential cumulative distribution function for the given y and beta. More... | |
| template<typename T_y , typename T_inv_scale > | |
| return_type_t< T_y, T_inv_scale > | exponential_cdf_log (const T_y &y, const T_inv_scale &beta) |
| template<typename T_y , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_inv_scale > * = nullptr> | |
| return_type_t< T_y, T_inv_scale > | exponential_lccdf (const T_y &y, const T_inv_scale &beta) |
| template<typename T_y , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_inv_scale > * = nullptr> | |
| return_type_t< T_y, T_inv_scale > | exponential_lcdf (const T_y &y, const T_inv_scale &beta) |
| template<bool propto, typename T_y , typename T_inv_scale > | |
| return_type_t< T_y, T_inv_scale > | exponential_log (const T_y &y, const T_inv_scale &beta) |
| template<typename T_y , typename T_inv_scale > | |
| return_type_t< T_y, T_inv_scale > | exponential_log (const T_y &y, const T_inv_scale &beta) |
| template<bool propto, typename T_y , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_inv_scale > * = nullptr> | |
| return_type_t< T_y, T_inv_scale > | exponential_lpdf (const T_y &y, const T_inv_scale &beta) |
| The log of an exponential density for y with the specified inverse scale parameter. More... | |
| template<typename T_y , typename T_inv_scale > | |
| return_type_t< T_y, T_inv_scale > | exponential_lpdf (const T_y &y, const T_inv_scale &beta) |
| template<typename T_inv , class RNG > | |
| VectorBuilder< true, double, T_inv >::type | exponential_rng (const T_inv &beta, RNG &rng) |
| Return a exponential random variate with inverse scale beta using the specified random number generator. More... | |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | frechet_ccdf_log (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr> | |
| return_type_t< T_y, T_shape, T_scale > | frechet_cdf (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | frechet_cdf_log (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr> | |
| return_type_t< T_y, T_shape, T_scale > | frechet_lccdf (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr> | |
| return_type_t< T_y, T_shape, T_scale > | frechet_lcdf (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | frechet_log (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | frechet_log (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr> | |
| return_type_t< T_y, T_shape, T_scale > | frechet_lpdf (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | frechet_lpdf (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_shape , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_shape, T_scale >::type | frechet_rng (const T_shape &alpha, const T_scale &sigma, RNG &rng) |
| Return a pseudorandom Frechet variate for the given shape and scale parameters using the specified random number generator. More... | |
| template<typename T_y , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_y, T_shape, T_inv_scale > | gamma_ccdf_log (const T_y &y, const T_shape &alpha, const T_inv_scale &beta) |
| template<typename T_y , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_y, T_shape, T_inv_scale > | gamma_cdf (const T_y &y, const T_shape &alpha, const T_inv_scale &beta) |
| The cumulative density function for a gamma distribution for y with the specified shape and inverse scale parameters. More... | |
| template<typename T_y , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_y, T_shape, T_inv_scale > | gamma_cdf_log (const T_y &y, const T_shape &alpha, const T_inv_scale &beta) |
| template<typename T_y , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_y, T_shape, T_inv_scale > | gamma_lccdf (const T_y &y, const T_shape &alpha, const T_inv_scale &beta) |
| template<typename T_y , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_y, T_shape, T_inv_scale > | gamma_lcdf (const T_y &y, const T_shape &alpha, const T_inv_scale &beta) |
| template<bool propto, typename T_y , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_y, T_shape, T_inv_scale > | gamma_log (const T_y &y, const T_shape &alpha, const T_inv_scale &beta) |
| The log of a gamma density for y with the specified shape and inverse scale parameters. More... | |
| template<typename T_y , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_y, T_shape, T_inv_scale > | gamma_log (const T_y &y, const T_shape &alpha, const T_inv_scale &beta) |
| template<bool propto, typename T_y , typename T_shape , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_inv_scale > * = nullptr> | |
| return_type_t< T_y, T_shape, T_inv_scale > | gamma_lpdf (const T_y &y, const T_shape &alpha, const T_inv_scale &beta) |
| The log of a gamma density for y with the specified shape and inverse scale parameters. More... | |
| template<typename T_y , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_y, T_shape, T_inv_scale > | gamma_lpdf (const T_y &y, const T_shape &alpha, const T_inv_scale &beta) |
| template<typename T_shape , typename T_inv , class RNG > | |
| VectorBuilder< true, double, T_shape, T_inv >::type | gamma_rng (const T_shape &alpha, const T_inv &beta, RNG &rng) |
| Return a gamma random variate for the given shape and inverse scale parameters using the specified random number generator. More... | |
| template<bool propto, typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 > | |
| return_type_t< T_y, T_F, T_G, T_V, T_W, T_m0, T_C0 > | gaussian_dlm_obs_log (const T_y &y, const T_F &F, const T_G &G, const T_V &V, const T_W &W, const T_m0 &m0, const T_C0 &C0) |
| template<typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 > | |
| return_type_t< T_y, T_F, T_G, T_V, T_W, T_m0, T_C0 > | gaussian_dlm_obs_log (const T_y &y, const T_F &F, const T_G &G, const T_V &V, const T_W &W, const T_m0 &m0, const T_C0 &C0) |
| template<bool propto, typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 , require_all_eigen_matrix_dynamic_t< T_y, T_F, T_G, T_V, T_W, T_C0 > * = nullptr, require_eigen_col_vector_t< T_m0 > * = nullptr> | |
| return_type_t< T_y, T_F, T_G, T_V, T_W, T_m0, T_C0 > | gaussian_dlm_obs_lpdf (const T_y &y, const T_F &F, const T_G &G, const T_V &V, const T_W &W, const T_m0 &m0, const T_C0 &C0) |
| The log of a Gaussian dynamic linear model (GDLM). More... | |
| template<typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 > | |
| return_type_t< T_y, T_F, T_G, T_V, T_W, T_m0, T_C0 > | gaussian_dlm_obs_lpdf (const T_y &y, const T_F &F, const T_G &G, const T_V &V, const T_W &W, const T_m0 &m0, const T_C0 &C0) |
| template<class RNG > | |
| Eigen::MatrixXd | gaussian_dlm_obs_rng (const Eigen::MatrixXd &F, const Eigen::MatrixXd &G, const Eigen::MatrixXd &V, const Eigen::MatrixXd &W, const Eigen::VectorXd &m0, const Eigen::MatrixXd &C0, const int T, RNG &rng) |
| Simulate random draw from Gaussian dynamic linear model (GDLM). More... | |
| template<class RNG > | |
| Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > | gaussian_dlm_obs_rng (const Eigen::MatrixXd &F, const Eigen::MatrixXd &G, const Eigen::VectorXd &V, const Eigen::MatrixXd &W, const Eigen::VectorXd &m0, const Eigen::MatrixXd &C0, const int T, RNG &rng) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | gumbel_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &beta) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | gumbel_cdf (const T_y &y, const T_loc &mu, const T_scale &beta) |
| Returns the Gumbel distribution cumulative distribution for the given location and scale. More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | gumbel_cdf_log (const T_y &y, const T_loc &mu, const T_scale &beta) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | gumbel_lccdf (const T_y &y, const T_loc &mu, const T_scale &beta) |
| Returns the Gumbel log complementary cumulative distribution for the given location and scale. More... | |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | gumbel_lcdf (const T_y &y, const T_loc &mu, const T_scale &beta) |
| Returns the Gumbel log cumulative distribution for the given location and scale. More... | |
| template<bool propto, typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | gumbel_log (const T_y &y, const T_loc &mu, const T_scale &beta) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | gumbel_log (const T_y &y, const T_loc &mu, const T_scale &beta) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | gumbel_lpdf (const T_y &y, const T_loc &mu, const T_scale &beta) |
| Returns the Gumbel log probability density for the given location and scale. More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | gumbel_lpdf (const T_y &y, const T_loc &mu, const T_scale &beta) |
| template<typename T_loc , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_loc, T_scale >::type | gumbel_rng (const T_loc &mu, const T_scale &beta, RNG &rng) |
| Return a Gumbel random variate with the given location and scale using the specified random number generator. More... | |
| template<typename T_omega , typename T_Gamma , typename T_rho , require_all_eigen_t< T_omega, T_Gamma > * = nullptr, require_eigen_col_vector_t< T_rho > * = nullptr> | |
| Eigen::MatrixXd | hmm_hidden_state_prob (const T_omega &log_omegas, const T_Gamma &Gamma, const T_rho &rho) |
| For a hidden Markov model with observation y, hidden state x, and parameters theta, compute the marginal probability vector for each x, given y and theta, p(x_i | y, theta). More... | |
| template<typename T_omega , typename T_Gamma , typename T_rho , class RNG , require_all_eigen_t< T_omega, T_Gamma > * = nullptr, require_eigen_col_vector_t< T_rho > * = nullptr> | |
| std::vector< int > | hmm_latent_rng (const T_omega &log_omegas, const T_Gamma &Gamma, const T_rho &rho, RNG &rng) |
| For a hidden Markov model with observation y, hidden state x, and parameters theta, generate samples from the posterior distribution of the hidden states, x. More... | |
| template<typename T_omega , typename T_Gamma , typename T_rho , typename T_alpha > | |
| auto | hmm_marginal_val (const Eigen::Matrix< T_omega, Eigen::Dynamic, Eigen::Dynamic > &omegas, const T_Gamma &Gamma_val, const T_rho &rho_val, Eigen::Matrix< T_alpha, Eigen::Dynamic, Eigen::Dynamic > &alphas, Eigen::Matrix< T_alpha, Eigen::Dynamic, 1 > &alpha_log_norms, T_alpha &norm_norm) |
| template<typename T_omega , typename T_Gamma , typename T_rho , require_all_eigen_t< T_omega, T_Gamma > * = nullptr, require_eigen_col_vector_t< T_rho > * = nullptr> | |
| auto | hmm_marginal (const T_omega &log_omegas, const T_Gamma &Gamma, const T_rho &rho) |
| For a Hidden Markov Model with observation y, hidden state x, and parameters theta, return the log marginal density, log p(y | theta). More... | |
| template<bool propto, typename T_n , typename T_N , typename T_a , typename T_b > | |
| double | hypergeometric_log (const T_n &n, const T_N &N, const T_a &a, const T_b &b) |
| template<typename T_n , typename T_N , typename T_a , typename T_b > | |
| double | hypergeometric_log (const T_n &n, const T_N &N, const T_a &a, const T_b &b) |
| template<bool propto, typename T_n , typename T_N , typename T_a , typename T_b > | |
| double | hypergeometric_lpmf (const T_n &n, const T_N &N, const T_a &a, const T_b &b) |
| template<typename T_n , typename T_N , typename T_a , typename T_b > | |
| double | hypergeometric_lpmf (const T_n &n, const T_N &N, const T_a &a, const T_b &b) |
| template<class RNG > | |
| int | hypergeometric_rng (int N, int a, int b, RNG &rng) |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | inv_chi_square_ccdf_log (const T_y &y, const T_dof &nu) |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | inv_chi_square_cdf (const T_y &y, const T_dof &nu) |
| Returns the inverse chi square cumulative distribution function for the given variate and degrees of freedom. More... | |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | inv_chi_square_cdf_log (const T_y &y, const T_dof &nu) |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | inv_chi_square_lccdf (const T_y &y, const T_dof &nu) |
| Returns the inverse chi square log complementary cumulative distribution function for the given variate and degrees of freedom. More... | |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | inv_chi_square_lcdf (const T_y &y, const T_dof &nu) |
| Returns the inverse chi square log cumulative distribution function for the given variate and degrees of freedom. More... | |
| template<bool propto, typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | inv_chi_square_log (const T_y &y, const T_dof &nu) |
| The log of an inverse chi-squared density for y with the specified degrees of freedom parameter. More... | |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | inv_chi_square_log (const T_y &y, const T_dof &nu) |
| template<bool propto, typename T_y , typename T_dof , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof > * = nullptr> | |
| return_type_t< T_y, T_dof > | inv_chi_square_lpdf (const T_y &y, const T_dof &nu) |
| The log of an inverse chi-squared density for y with the specified degrees of freedom parameter. More... | |
| template<typename T_y , typename T_dof > | |
| return_type_t< T_y, T_dof > | inv_chi_square_lpdf (const T_y &y, const T_dof &nu) |
| template<typename T_deg , class RNG > | |
| VectorBuilder< true, double, T_deg >::type | inv_chi_square_rng (const T_deg &nu, RNG &rng) |
| Return a pseudorandom inverse chi squared variate with the nu degrees of freedom using the specified random number generator. More... | |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | inv_gamma_ccdf_log (const T_y &y, const T_shape &alpha, const T_scale &beta) |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | inv_gamma_cdf (const T_y &y, const T_shape &alpha, const T_scale &beta) |
| The CDF of an inverse gamma density for y with the specified shape and scale parameters. More... | |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | inv_gamma_cdf_log (const T_y &y, const T_shape &alpha, const T_scale &beta) |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | inv_gamma_lccdf (const T_y &y, const T_shape &alpha, const T_scale &beta) |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | inv_gamma_lcdf (const T_y &y, const T_shape &alpha, const T_scale &beta) |
| template<bool propto, typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | inv_gamma_log (const T_y &y, const T_shape &alpha, const T_scale &beta) |
| The log of an inverse gamma density for y with the specified shape and scale parameters. More... | |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | inv_gamma_log (const T_y &y, const T_shape &alpha, const T_scale &beta) |
| template<bool propto, typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr> | |
| return_type_t< T_y, T_shape, T_scale > | inv_gamma_lpdf (const T_y &y, const T_shape &alpha, const T_scale &beta) |
| The log of an inverse gamma density for y with the specified shape and scale parameters. More... | |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | inv_gamma_lpdf (const T_y &y, const T_shape &alpha, const T_scale &beta) |
| template<typename T_shape , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_shape, T_scale >::type | inv_gamma_rng (const T_shape &alpha, const T_scale &beta, RNG &rng) |
| Return a pseudorandom inverse gamma variate for the given shape and scale parameters using the specified random number generator. More... | |
| template<bool propto, typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | inv_wishart_log (const T_y &W, const T_dof &nu, const T_scale &S) |
| The log of the Inverse-Wishart density for the given W, degrees of freedom, and scale matrix. More... | |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | inv_wishart_log (const T_y &W, const T_dof &nu, const T_scale &S) |
| template<bool propto, typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | inv_wishart_lpdf (const T_y &W, const T_dof &nu, const T_scale &S) |
| The log of the Inverse-Wishart density for the given W, degrees of freedom, and scale matrix. More... | |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | inv_wishart_lpdf (const T_y &W, const T_dof &nu, const T_scale &S) |
| template<class RNG > | |
| Eigen::MatrixXd | inv_wishart_rng (double nu, const Eigen::MatrixXd &S, RNG &rng) |
| template<bool propto, typename T_covar , typename T_shape > | |
| return_type_t< T_covar, T_shape > | lkj_corr_cholesky_log (const T_covar &L, const T_shape &eta) |
| template<typename T_covar , typename T_shape > | |
| return_type_t< T_covar, T_shape > | lkj_corr_cholesky_log (const T_covar &L, const T_shape &eta) |
| template<bool propto, typename T_covar , typename T_shape > | |
| return_type_t< T_covar, T_shape > | lkj_corr_cholesky_lpdf (const T_covar &L, const T_shape &eta) |
| template<typename T_covar , typename T_shape > | |
| return_type_t< T_covar, T_shape > | lkj_corr_cholesky_lpdf (const T_covar &L, const T_shape &eta) |
| template<class RNG > | |
| Eigen::MatrixXd | lkj_corr_cholesky_rng (size_t K, double eta, RNG &rng) |
| template<bool propto, typename T_y , typename T_shape > | |
| return_type_t< T_y, T_shape > | lkj_corr_log (const T_y &y, const T_shape &eta) |
| template<typename T_y , typename T_shape > | |
| return_type_t< T_y, T_shape > | lkj_corr_log (const T_y &y, const T_shape &eta) |
| template<typename T_shape > | |
| return_type_t< double, T_shape > | do_lkj_constant (const T_shape &eta, const unsigned int &K) |
| template<bool propto, typename T_y , typename T_shape > | |
| return_type_t< T_y, T_shape > | lkj_corr_lpdf (const T_y &y, const T_shape &eta) |
| template<typename T_y , typename T_shape > | |
| return_type_t< T_y, T_shape > | lkj_corr_lpdf (const T_y &y, const T_shape &eta) |
| template<class RNG > | |
| Eigen::MatrixXd | lkj_corr_rng (size_t K, double eta, RNG &rng) |
| Return a random correlation matrix (symmetric, positive definite, unit diagonal) of the specified dimensionality drawn from the LKJ distribution with the specified degrees of freedom using the specified random number generator. More... | |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | lkj_cov_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &eta) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | lkj_cov_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &eta) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape , require_eigen_matrix_dynamic_t< T_y > * = nullptr, require_all_eigen_col_vector_t< T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | lkj_cov_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &eta) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | lkj_cov_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &eta) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | logistic_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | logistic_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | logistic_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | logistic_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | logistic_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | logistic_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | logistic_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | logistic_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | logistic_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_loc , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_loc, T_scale >::type | logistic_rng (const T_loc &mu, const T_scale &sigma, RNG &rng) |
| Return a Logistic random variate for the given location and scale using the specified random number generator. More... | |
| template<typename T_y , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_scale, T_shape > | loglogistic_cdf (const T_y &y, const T_scale &alpha, const T_shape &beta) |
| The loglogistic cumulative distribution function for the specified scalar(s) given the specified scales(s) and shape(s). More... | |
| template<bool propto, typename T_y , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_scale, T_shape > | loglogistic_lpdf (const T_y &y, const T_scale &alpha, const T_shape &beta) |
| The log of the loglogistic density for the specified scalar(s) given the specified scales(s) and shape(s). More... | |
| template<typename T_y , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_scale, T_shape > | loglogistic_lpdf (const T_y &y, const T_scale &alpha, const T_shape &beta) |
| template<typename T_scale , typename T_shape , class RNG > | |
| VectorBuilder< true, double, T_scale, T_shape >::type | loglogistic_rng (const T_scale &alpha, const T_shape &beta, RNG &rng) |
| Return a loglogistic random variate for the given scale and shape parameters using the specified random number generator. More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | lognormal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | lognormal_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | lognormal_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | lognormal_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | lognormal_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | lognormal_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | lognormal_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | lognormal_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | lognormal_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_loc , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_loc, T_scale >::type | lognormal_rng (const T_loc &mu, const T_scale &sigma, RNG &rng) |
| Return a lognormal random variate for the given location and scale using the specified random number generator. More... | |
| template<bool propto, typename T_y , typename T_Mu , typename T_Sigma , typename T_D , require_all_matrix_t< T_y, T_Mu, T_Sigma, T_D > * = nullptr> | |
| return_type_t< T_y, T_Mu, T_Sigma, T_D > | matrix_normal_prec_log (const T_y &y, const T_Mu &Mu, const T_Sigma &Sigma, const T_D &D) |
| The log of the matrix normal density for the given y, mu, Sigma and D where Sigma and D are given as precision matrices, not covariance matrices. More... | |
| template<typename T_y , typename T_Mu , typename T_Sigma , typename T_D , require_all_matrix_t< T_y, T_Mu, T_Sigma, T_D > * = nullptr> | |
| return_type_t< T_y, T_Mu, T_Sigma, T_D > | matrix_normal_prec_log (const T_y &y, const T_Mu &Mu, const T_Sigma &Sigma, const T_D &D) |
| template<bool propto, typename T_y , typename T_Mu , typename T_Sigma , typename T_D , require_all_matrix_t< T_y, T_Mu, T_Sigma, T_D > * = nullptr> | |
| return_type_t< T_y, T_Mu, T_Sigma, T_D > | matrix_normal_prec_lpdf (const T_y &y, const T_Mu &Mu, const T_Sigma &Sigma, const T_D &D) |
| The log of the matrix normal density for the given y, mu, Sigma and D where Sigma and D are given as precision matrices, not covariance matrices. More... | |
| template<typename T_y , typename T_Mu , typename T_Sigma , typename T_D , require_all_matrix_t< T_y, T_Mu, T_Sigma, T_D > * = nullptr> | |
| return_type_t< T_y, T_Mu, T_Sigma, T_D > | matrix_normal_prec_lpdf (const T_y &y, const T_Mu &Mu, const T_Sigma &Sigma, const T_D &D) |
| template<class RNG > | |
| Eigen::MatrixXd | matrix_normal_prec_rng (const Eigen::MatrixXd &Mu, const Eigen::MatrixXd &Sigma, const Eigen::MatrixXd &D, RNG &rng) |
| Sample from the the matrix normal distribution for the given Mu, Sigma and D where Sigma and D are given as precision matrices, not covariance matrices. More... | |
| template<bool propto, typename T_y , typename T_covar , typename T_w > | |
| return_type_t< T_y, T_covar, T_w > | multi_gp_cholesky_log (const T_y &y, const T_covar &L, const T_w &w) |
| The log of a multivariate Gaussian Process for the given y, w, and a Cholesky factor L of the kernel matrix Sigma. More... | |
| template<typename T_y , typename T_covar , typename T_w > | |
| return_type_t< T_y, T_covar, T_w > | multi_gp_cholesky_log (const T_y &y, const T_covar &L, const T_w &w) |
| template<bool propto, typename T_y , typename T_covar , typename T_w , require_all_eigen_matrix_dynamic_t< T_y, T_covar > * = nullptr, require_eigen_col_vector_t< T_w > * = nullptr> | |
| return_type_t< T_y, T_covar, T_w > | multi_gp_cholesky_lpdf (const T_y &y, const T_covar &L, const T_w &w) |
| The log of a multivariate Gaussian Process for the given y, w, and a Cholesky factor L of the kernel matrix Sigma. More... | |
| template<typename T_y , typename T_covar , typename T_w > | |
| return_type_t< T_y, T_covar, T_w > | multi_gp_cholesky_lpdf (const T_y &y, const T_covar &L, const T_w &w) |
| template<bool propto, typename T_y , typename T_covar , typename T_w > | |
| return_type_t< T_y, T_covar, T_w > | multi_gp_log (const T_y &y, const T_covar &Sigma, const T_w &w) |
| The log of a multivariate Gaussian Process for the given y, Sigma, and w. More... | |
| template<typename T_y , typename T_covar , typename T_w > | |
| return_type_t< T_y, T_covar, T_w > | multi_gp_log (const T_y &y, const T_covar &Sigma, const T_w &w) |
| template<bool propto, typename T_y , typename T_covar , typename T_w , require_all_matrix_t< T_y, T_covar > * = nullptr, require_col_vector_t< T_w > * = nullptr> | |
| return_type_t< T_y, T_covar, T_w > | multi_gp_lpdf (const T_y &y, const T_covar &Sigma, const T_w &w) |
| The log of a multivariate Gaussian Process for the given y, Sigma, and w. More... | |
| template<typename T_y , typename T_covar , typename T_w > | |
| return_type_t< T_y, T_covar, T_w > | multi_gp_lpdf (const T_y &y, const T_covar &Sigma, const T_w &w) |
| template<bool propto, typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_cholesky_log (const T_y &y, const T_loc &mu, const T_covar &L) |
| The log of the multivariate normal density for the given y, mu, and a Cholesky factor L of the variance matrix. More... | |
| template<typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_cholesky_log (const T_y &y, const T_loc &mu, const T_covar &L) |
| template<bool propto, typename T_y , typename T_loc , typename T_covar , require_any_not_vector_vt< is_stan_scalar, T_y, T_loc > * = nullptr, require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_covar > * = nullptr> | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_cholesky_lpdf (const T_y &y, const T_loc &mu, const T_covar &L) |
| The log of the multivariate normal density for the given y, mu, and a Cholesky factor L of the variance matrix. More... | |
| template<typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_cholesky_lpdf (const T_y &y, const T_loc &mu, const T_covar &L) |
| template<typename T_loc , class RNG > | |
| StdVectorBuilder< true, Eigen::VectorXd, T_loc >::type | multi_normal_cholesky_rng (const T_loc &mu, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &L, RNG &rng) |
| Return a multivariate normal random variate with the given location and Cholesky factorization of the covariance using the specified random number generator. More... | |
| template<bool propto, typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_log (const T_y &y, const T_loc &mu, const T_covar &Sigma) |
| template<typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_log (const T_y &y, const T_loc &mu, const T_covar &Sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_lpdf (const T_y &y, const T_loc &mu, const T_covar &Sigma) |
| template<typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_lpdf (const T_y &y, const T_loc &mu, const T_covar &Sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_prec_log (const T_y &y, const T_loc &mu, const T_covar &Sigma) |
| template<typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_prec_log (const T_y &y, const T_loc &mu, const T_covar &Sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_prec_lpdf (const T_y &y, const T_loc &mu, const T_covar &Sigma) |
| template<typename T_y , typename T_loc , typename T_covar > | |
| return_type_t< T_y, T_loc, T_covar > | multi_normal_prec_lpdf (const T_y &y, const T_loc &mu, const T_covar &Sigma) |
| template<typename T_loc , class RNG > | |
| StdVectorBuilder< true, Eigen::VectorXd, T_loc >::type | multi_normal_prec_rng (const T_loc &mu, const Eigen::MatrixXd &S, RNG &rng) |
| Return a multivariate normal random variate with the given location and precision using the specified random number generator. More... | |
| template<typename T_loc , class RNG > | |
| StdVectorBuilder< true, Eigen::VectorXd, T_loc >::type | multi_normal_rng (const T_loc &mu, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &S, RNG &rng) |
| Return a multivariate normal random variate with the given location and covariance using the specified random number generator. More... | |
| template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | multi_student_t_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &Sigma) |
| Return the log of the multivariate Student t distribution at the specified arguments. More... | |
| template<typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | multi_student_t_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &Sigma) |
| template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | multi_student_t_lpdf (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &Sigma) |
| Return the log of the multivariate Student t distribution at the specified arguments. More... | |
| template<typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | multi_student_t_lpdf (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &Sigma) |
| template<typename T_loc , class RNG > | |
| StdVectorBuilder< true, Eigen::VectorXd, T_loc >::type | multi_student_t_rng (double nu, const T_loc &mu, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &S, RNG &rng) |
| Return a multivariate student-t random variate with the given degrees of freedom location and covariance using the specified random number generator. More... | |
| template<bool propto, typename T_prob > | |
| return_type_t< T_prob > | multinomial_log (const std::vector< int > &ns, const T_prob &theta) |
| template<typename T_prob > | |
| return_type_t< T_prob > | multinomial_log (const std::vector< int > &ns, const T_prob &theta) |
| template<bool propto, typename T_beta , require_eigen_col_vector_t< T_beta > * = nullptr> | |
| return_type_t< T_beta > | multinomial_logit_log (const std::vector< int > &ns, const T_beta &beta) |
| template<typename T_beta , require_eigen_col_vector_t< T_beta > * = nullptr> | |
| return_type_t< T_beta > | multinomial_logit_log (const std::vector< int > &ns, const T_beta &beta) |
| template<bool propto, typename T_beta , typename T_prob = scalar_type_t<T_beta>, require_eigen_col_vector_t< T_beta > * = nullptr> | |
| return_type_t< T_prob > | multinomial_logit_lpmf (const std::vector< int > &ns, const T_beta &beta) |
| Multinomial log PMF in log parametrization. More... | |
| template<typename T_beta , require_eigen_col_vector_t< T_beta > * = nullptr> | |
| return_type_t< T_beta > | multinomial_logit_lpmf (const std::vector< int > &ns, const T_beta &beta) |
| template<class RNG , typename T_beta , require_eigen_col_vector_t< T_beta > * = nullptr> | |
| std::vector< int > | multinomial_logit_rng (const T_beta &beta, int N, RNG &rng) |
| Return a draw from a Multinomial distribution given a a vector of unnormalized log probabilities and a pseudo-random number generator. More... | |
| template<bool propto, typename T_prob , require_eigen_col_vector_t< T_prob > * = nullptr> | |
| return_type_t< T_prob > | multinomial_lpmf (const std::vector< int > &ns, const T_prob &theta) |
| template<typename T_prob > | |
| return_type_t< T_prob > | multinomial_lpmf (const std::vector< int > &ns, const T_prob &theta) |
| template<class T_theta , class RNG , require_eigen_col_vector_t< T_theta > * = nullptr> | |
| std::vector< int > | multinomial_rng (const T_theta &theta, int N, RNG &rng) |
| template<typename T_n , typename T_location , typename T_precision > | |
| return_type_t< T_location, T_precision > | neg_binomial_2_ccdf_log (const T_n &n, const T_location &mu, const T_precision &phi) |
| template<typename T_n , typename T_location , typename T_precision > | |
| return_type_t< T_location, T_precision > | neg_binomial_2_cdf (const T_n &n, const T_location &mu, const T_precision &phi) |
| template<typename T_n , typename T_location , typename T_precision > | |
| return_type_t< T_location, T_precision > | neg_binomial_2_cdf_log (const T_n &n, const T_location &mu, const T_precision &phi) |
| template<typename T_n , typename T_location , typename T_precision > | |
| return_type_t< T_location, T_precision > | neg_binomial_2_lccdf (const T_n &n, const T_location &mu, const T_precision &phi) |
| template<typename T_n , typename T_location , typename T_precision > | |
| return_type_t< T_location, T_precision > | neg_binomial_2_lcdf (const T_n &n, const T_location &mu, const T_precision &phi) |
| template<bool propto, typename T_n , typename T_location , typename T_precision > | |
| return_type_t< T_location, T_precision > | neg_binomial_2_log (const T_n &n, const T_location &mu, const T_precision &phi) |
| template<typename T_n , typename T_location , typename T_precision > | |
| return_type_t< T_location, T_precision > | neg_binomial_2_log (const T_n &n, const T_location &mu, const T_precision &phi) |
| template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , typename T_precision > | |
| return_type_t< T_x, T_alpha, T_beta, T_precision > | neg_binomial_2_log_glm_log (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta, const T_precision &phi) |
| template<typename T_y , typename T_x , typename T_alpha , typename T_beta , typename T_precision > | |
| return_type_t< T_x, T_alpha, T_beta, T_precision > | neg_binomial_2_log_glm_log (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta, const T_precision &phi) |
| template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , typename T_precision , require_eigen_t< T_x > * = nullptr> | |
| return_type_t< T_x, T_alpha, T_beta, T_precision > | neg_binomial_2_log_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta, const T_precision &phi) |
| Returns the log PMF of the Generalized Linear Model (GLM) with Negative-Binomial-2 distribution and log link function. More... | |
| template<typename T_y , typename T_x , typename T_alpha , typename T_beta , typename T_precision > | |
| return_type_t< T_x, T_alpha, T_beta, T_precision > | neg_binomial_2_log_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta, const T_precision &phi) |
| template<bool propto, typename T_n , typename T_log_location , typename T_precision > | |
| return_type_t< T_log_location, T_precision > | neg_binomial_2_log_log (const T_n &n, const T_log_location &eta, const T_precision &phi) |
| template<typename T_n , typename T_log_location , typename T_precision > | |
| return_type_t< T_log_location, T_precision > | neg_binomial_2_log_log (const T_n &n, const T_log_location &eta, const T_precision &phi) |
| template<bool propto, typename T_n , typename T_log_location , typename T_precision , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_log_location, T_precision > * = nullptr> | |
| return_type_t< T_log_location, T_precision > | neg_binomial_2_log_lpmf (const T_n &n, const T_log_location &eta, const T_precision &phi) |
| template<typename T_n , typename T_log_location , typename T_precision > | |
| return_type_t< T_log_location, T_precision > | neg_binomial_2_log_lpmf (const T_n &n, const T_log_location &eta, const T_precision &phi) |
| template<typename T_loc , typename T_inv , class RNG > | |
| VectorBuilder< true, int, T_loc, T_inv >::type | neg_binomial_2_log_rng (const T_loc &eta, const T_inv &phi, RNG &rng) |
| Return a negative binomial random variate with the specified log-location and inverse dispersion parameters using the given random number generator. More... | |
| template<bool propto, typename T_n , typename T_location , typename T_precision , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_location, T_precision > * = nullptr> | |
| return_type_t< T_location, T_precision > | neg_binomial_2_lpmf (const T_n &n, const T_location &mu, const T_precision &phi) |
| template<typename T_n , typename T_location , typename T_precision > | |
| return_type_t< T_location, T_precision > | neg_binomial_2_lpmf (const T_n &n, const T_location &mu, const T_precision &phi) |
| template<typename T_loc , typename T_prec , class RNG > | |
| VectorBuilder< true, int, T_loc, T_prec >::type | neg_binomial_2_rng (const T_loc &mu, const T_prec &phi, RNG &rng) |
| Return a negative binomial random variate with the specified location and precision parameters using the given random number generator. More... | |
| template<typename T_n , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_shape, T_inv_scale > | neg_binomial_ccdf_log (const T_n &n, const T_shape &alpha, const T_inv_scale &beta) |
| template<typename T_n , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_shape, T_inv_scale > | neg_binomial_cdf (const T_n &n, const T_shape &alpha, const T_inv_scale &beta) |
| template<typename T_n , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_shape, T_inv_scale > | neg_binomial_cdf_log (const T_n &n, const T_shape &alpha, const T_inv_scale &beta) |
| template<typename T_n , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_shape, T_inv_scale > | neg_binomial_lccdf (const T_n &n, const T_shape &alpha, const T_inv_scale &beta_param) |
| template<typename T_n , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_shape, T_inv_scale > | neg_binomial_lcdf (const T_n &n, const T_shape &alpha, const T_inv_scale &beta_param) |
| template<bool propto, typename T_n , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_shape, T_inv_scale > | neg_binomial_log (const T_n &n, const T_shape &alpha, const T_inv_scale &beta) |
| template<typename T_n , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_shape, T_inv_scale > | neg_binomial_log (const T_n &n, const T_shape &alpha, const T_inv_scale &beta) |
| template<bool propto, typename T_n , typename T_shape , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_shape, T_inv_scale > * = nullptr> | |
| return_type_t< T_shape, T_inv_scale > | neg_binomial_lpmf (const T_n &n, const T_shape &alpha, const T_inv_scale &beta) |
| template<typename T_n , typename T_shape , typename T_inv_scale > | |
| return_type_t< T_shape, T_inv_scale > | neg_binomial_lpmf (const T_n &n, const T_shape &alpha, const T_inv_scale &beta) |
| template<typename T_shape , typename T_inv , class RNG > | |
| VectorBuilder< true, int, T_shape, T_inv >::type | neg_binomial_rng (const T_shape &alpha, const T_inv &beta, RNG &rng) |
| Return a negative binomial random variate with the specified shape and inverse scale parameters using the given random number generator. More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | normal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | normal_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| Calculates the normal cumulative distribution function for the given variate, location, and scale. More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | normal_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , typename T_scale > | |
| return_type_t< T_y, T_x, T_alpha, T_beta, T_scale > | normal_id_glm_log (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta, const T_scale &sigma) |
| template<typename T_y , typename T_x , typename T_alpha , typename T_beta , typename T_scale > | |
| return_type_t< T_y, T_x, T_alpha, T_beta, T_scale > | normal_id_glm_log (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , typename T_scale , require_eigen_t< T_x > * = nullptr> | |
| return_type_t< T_y, T_x, T_alpha, T_beta, T_scale > | normal_id_glm_lpdf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta, const T_scale &sigma) |
| Returns the log PDF of the Generalized Linear Model (GLM) with Normal distribution and id link function. More... | |
| template<typename T_y , typename T_x , typename T_alpha , typename T_beta , typename T_scale > | |
| return_type_t< T_y, T_x, T_alpha, T_beta, T_scale > | normal_id_glm_lpdf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | normal_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | normal_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s). More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale > | normal_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s). More... | |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | normal_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma) |
| template<typename T_loc , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_loc, T_scale >::type | normal_rng (const T_loc &mu, const T_scale &sigma, RNG &rng) |
| Return a Normal random variate for the given location and scale using the specified random number generator. More... | |
| template<bool propto, typename T_y , typename T_s , typename T_n , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_s, T_loc, T_scale > | normal_sufficient_log (const T_y &y_bar, const T_s &s_squared, const T_n &n_obs, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_s , typename T_n , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_s, T_loc, T_scale > | normal_sufficient_log (const T_y &y_bar, const T_s &s_squared, const T_n &n_obs, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_s , typename T_n , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_s, T_loc, T_scale > | normal_sufficient_lpdf (const T_y &y_bar, const T_s &s_squared, const T_n &n_obs, const T_loc &mu, const T_scale &sigma) |
| The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s). More... | |
| template<typename T_y , typename T_s , typename T_n , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_s, T_loc, T_scale > | normal_sufficient_lpdf (const T_y &y_bar, const T_s &s_squared, const T_n &n_obs, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_x , typename T_beta , typename T_cuts , require_eigen_t< T_x > * = nullptr, require_all_eigen_col_vector_t< T_beta, T_cuts > * = nullptr> | |
| return_type_t< T_x, T_beta, T_cuts > | ordered_logistic_glm_lpmf (const T_y &y, const T_x &x, const T_beta &beta, const T_cuts &cuts) |
| Returns the log PMF of the ordinal regression Generalized Linear Model (GLM). More... | |
| template<typename T_y , typename T_x , typename T_beta , typename T_cuts > | |
| return_type_t< T_x, T_beta, T_cuts > | ordered_logistic_glm_lpmf (const T_y &y, const T_x &x, const T_beta &beta, const T_cuts &cuts) |
| template<bool propto, typename T_y , typename T_loc , typename T_cut > | |
| return_type_t< T_loc, T_cut > | ordered_logistic_log (const T_y &y, const T_loc &lambda, const T_cut &c) |
| Returns the (natural) log probability of the integer/s given the vector of continuous location/s and specified cutpoints in an ordered logistic model. More... | |
| template<typename T_y , typename T_loc , typename T_cut > | |
| return_type_t< T_loc, T_cut > | ordered_logistic_log (const T_y &y, const T_loc &lambda, const T_cut &c) |
| template<bool propto, typename T_y , typename T_loc , typename T_cut , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_cut > * = nullptr> | |
| return_type_t< T_loc, T_cut > | ordered_logistic_lpmf (const T_y &y, const T_loc &lambda, const T_cut &c) |
| Returns the (natural) log probability of the specified array of integers given the vector of continuous locations and specified cutpoints in an ordered logistic model. More... | |
| template<typename T_y , typename T_loc , typename T_cut > | |
| return_type_t< T_loc, T_cut > | ordered_logistic_lpmf (const T_y &y, const T_loc &lambda, const T_cut &c) |
| template<class RNG > | |
| int | ordered_logistic_rng (double eta, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &c, RNG &rng) |
| template<bool propto, typename T_y , typename T_loc , typename T_cut > | |
| return_type_t< T_loc, T_cut > | ordered_probit_log (const T_y &y, const T_loc &lambda, const T_cut &c) |
| Returns the (natural) log probability of the integer/s given the vector of continuous location/s and specified cutpoints in an ordered probit model. More... | |
| template<typename T_y , typename T_loc , typename T_cut > | |
| return_type_t< T_loc, T_cut > | ordered_probit_log (const T_y &y, const T_loc &lambda, const T_cut &c) |
| template<bool propto, typename T_y , typename T_loc , typename T_cut > | |
| return_type_t< T_loc, T_cut > | ordered_probit_lpmf (const T_y &y, const T_loc &lambda, const T_cut &c) |
| Returns the (natural) log probability of the specified array of integers given the vector of continuous locations and array of specified cutpoints in an ordered probit model. More... | |
| template<typename T_y , typename T_loc , typename T_cut > | |
| return_type_t< T_loc, T_cut > | ordered_probit_lpmf (const T_y &y, const T_loc &lambda, const T_cut &c) |
| template<class RNG > | |
| int | ordered_probit_rng (double eta, const Eigen::VectorXd &c, RNG &rng) |
| template<typename T_y , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_scale, T_shape > | pareto_ccdf_log (const T_y &y, const T_scale &y_min, const T_shape &alpha) |
| template<typename T_y , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_scale, T_shape > | pareto_cdf (const T_y &y, const T_scale &y_min, const T_shape &alpha) |
| template<typename T_y , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_scale, T_shape > | pareto_cdf_log (const T_y &y, const T_scale &y_min, const T_shape &alpha) |
| template<typename T_y , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_scale, T_shape > | pareto_lccdf (const T_y &y, const T_scale &y_min, const T_shape &alpha) |
| template<typename T_y , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_scale, T_shape > | pareto_lcdf (const T_y &y, const T_scale &y_min, const T_shape &alpha) |
| template<bool propto, typename T_y , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_scale, T_shape > | pareto_log (const T_y &y, const T_scale &y_min, const T_shape &alpha) |
| template<typename T_y , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_scale, T_shape > | pareto_log (const T_y &y, const T_scale &y_min, const T_shape &alpha) |
| template<bool propto, typename T_y , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_scale, T_shape > | pareto_lpdf (const T_y &y, const T_scale &y_min, const T_shape &alpha) |
| template<typename T_y , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_scale, T_shape > | pareto_lpdf (const T_y &y, const T_scale &y_min, const T_shape &alpha) |
| template<typename T_shape , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_shape, T_scale >::type | pareto_rng (const T_scale &y_min, const T_shape &alpha, RNG &rng) |
| Return a Pareto random variate for the given shape and scale parameters using the specified random number generator. More... | |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | pareto_type_2_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | pareto_type_2_cdf (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | pareto_type_2_cdf_log (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | pareto_type_2_lccdf (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | pareto_type_2_lcdf (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | pareto_type_2_log (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | pareto_type_2_log (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | pareto_type_2_lpdf (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | pareto_type_2_lpdf (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha) |
| template<typename T_loc , typename T_scale , typename T_shape , class RNG > | |
| VectorBuilder< true, double, T_loc, T_scale, T_shape >::type | pareto_type_2_rng (const T_loc &mu, const T_scale &lambda, const T_shape &alpha, RNG &rng) |
| Return a Pareto type 2 random variate for the given location, scale, and shape using the specified random number generator. More... | |
| template<typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_ccdf_log (const T_y &y, const T_theta &theta) |
| template<bool propto, typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_cdf (const T_y &y, const T_theta &theta) |
| Returns the CDF for the Poisson-binomial distribution evaluated at the specified number of successes and probabilities of successes. More... | |
| template<typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_cdf (const T_y &y, const T_theta &theta) |
| template<typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_cdf_log (const T_y &y, const T_theta &theta) |
| template<bool propto, typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_lccdf (const T_y &y, const T_theta &theta) |
| Returns the log CCDF for the Poisson-binomial distribution evaluated at the specified number of successes and probabilities of successes. More... | |
| template<typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_lccdf (const T_y &y, const T_theta &theta) |
| template<bool propto, typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_lcdf (const T_y &y, const T_theta &theta) |
| Returns the log CDF for the Poisson-binomial distribution evaluated at the specified number of successes and probabilities of successes. More... | |
| template<typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_lcdf (const T_y &y, const T_theta &theta) |
| template<bool propto, typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_log (const T_y &y, const T_theta &theta) |
| template<typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_log (const T_y &y, const T_theta &theta) |
| template<bool propto, typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_lpmf (const T_y &y, const T_theta &theta) |
| Returns the log PMF for the Poisson-binomial distribution evaluated at an specified array of numbers of successes and probabilities of successes. More... | |
| template<typename T_y , typename T_theta > | |
| return_type_t< T_theta > | poisson_binomial_lpmf (const T_y &y, const T_theta &theta) |
| template<typename T_theta , typename RNG , require_eigen_vt< std::is_arithmetic, T_theta > * = nullptr> | |
| int | poisson_binomial_rng (const T_theta &theta, RNG &rng) |
| Return a pseudorandom Poisson binomial random variable for the given vector of success parameters using the specified random number generator. More... | |
| template<typename T_n , typename T_rate > | |
| return_type_t< T_rate > | poisson_ccdf_log (const T_n &n, const T_rate &lambda) |
| template<typename T_n , typename T_rate > | |
| return_type_t< T_rate > | poisson_cdf (const T_n &n, const T_rate &lambda) |
| template<typename T_n , typename T_rate > | |
| return_type_t< T_rate > | poisson_cdf_log (const T_n &n, const T_rate &lambda) |
| template<typename T_n , typename T_rate > | |
| return_type_t< T_rate > | poisson_lccdf (const T_n &n, const T_rate &lambda) |
| template<typename T_n , typename T_rate > | |
| return_type_t< T_rate > | poisson_lcdf (const T_n &n, const T_rate &lambda) |
| template<bool propto, typename T_n , typename T_rate > | |
| return_type_t< T_rate > | poisson_log (const T_n &n, const T_rate &lambda) |
| template<typename T_n , typename T_rate > | |
| return_type_t< T_rate > | poisson_log (const T_n &n, const T_rate &lambda) |
| template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta > | |
| return_type_t< T_x, T_alpha, T_beta > | poisson_log_glm_log (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| template<typename T_y , typename T_x , typename T_alpha , typename T_beta > | |
| return_type_t< T_x, T_alpha, T_beta > | poisson_log_glm_log (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , require_eigen_t< T_x > * = nullptr> | |
| return_type_t< T_x, T_alpha, T_beta > | poisson_log_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| Returns the log PMF of the Generalized Linear Model (GLM) with Poisson distribution and log link function. More... | |
| template<typename T_y , typename T_x , typename T_alpha , typename T_beta > | |
| return_type_t< T_x, T_alpha, T_beta > | poisson_log_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta) |
| template<bool propto, typename T_n , typename T_log_rate > | |
| return_type_t< T_log_rate > | poisson_log_log (const T_n &n, const T_log_rate &alpha) |
| template<typename T_n , typename T_log_rate > | |
| return_type_t< T_log_rate > | poisson_log_log (const T_n &n, const T_log_rate &alpha) |
| template<bool propto, typename T_n , typename T_log_rate , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_log_rate > * = nullptr> | |
| return_type_t< T_log_rate > | poisson_log_lpmf (const T_n &n, const T_log_rate &alpha) |
| template<typename T_n , typename T_log_rate > | |
| return_type_t< T_log_rate > | poisson_log_lpmf (const T_n &n, const T_log_rate &alpha) |
| template<typename T_rate , class RNG > | |
| VectorBuilder< true, int, T_rate >::type | poisson_log_rng (const T_rate &alpha, RNG &rng) |
| Return a Poisson random variate with specified log rate parameter using the given random number generator. More... | |
| template<bool propto, typename T_n , typename T_rate , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_rate > * = nullptr> | |
| return_type_t< T_rate > | poisson_lpmf (const T_n &n, const T_rate &lambda) |
| template<typename T_n , typename T_rate > | |
| return_type_t< T_rate > | poisson_lpmf (const T_n &n, const T_rate &lambda) |
| template<typename T_rate , class RNG > | |
| VectorBuilder< true, int, T_rate >::type | poisson_rng (const T_rate &lambda, RNG &rng) |
| Return a Poisson random variate with specified rate parameter using the given random number generator. More... | |
| template<typename T_y , typename T_scale > | |
| return_type_t< T_y, T_scale > | rayleigh_ccdf_log (const T_y &y, const T_scale &sigma) |
| template<typename T_y , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale > * = nullptr> | |
| return_type_t< T_y, T_scale > | rayleigh_cdf (const T_y &y, const T_scale &sigma) |
| template<typename T_y , typename T_scale > | |
| return_type_t< T_y, T_scale > | rayleigh_cdf_log (const T_y &y, const T_scale &sigma) |
| template<typename T_y , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale > * = nullptr> | |
| return_type_t< T_y, T_scale > | rayleigh_lccdf (const T_y &y, const T_scale &sigma) |
| template<typename T_y , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale > * = nullptr> | |
| return_type_t< T_y, T_scale > | rayleigh_lcdf (const T_y &y, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_scale > | |
| return_type_t< T_y, T_scale > | rayleigh_log (const T_y &y, const T_scale &sigma) |
| template<typename T_y , typename T_scale > | |
| return_type_t< T_y, T_scale > | rayleigh_log (const T_y &y, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale > * = nullptr> | |
| return_type_t< T_y, T_scale > | rayleigh_lpdf (const T_y &y, const T_scale &sigma) |
| template<typename T_y , typename T_scale > | |
| return_type_t< T_y, T_scale > | rayleigh_lpdf (const T_y &y, const T_scale &sigma) |
| template<typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_scale >::type | rayleigh_rng (const T_scale &sigma, RNG &rng) |
| Return a Rayleigh random variate with scale parameter sigma using the specified random number generator. More... | |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | scaled_inv_chi_square_ccdf_log (const T_y &y, const T_dof &nu, const T_scale &s) |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | scaled_inv_chi_square_cdf (const T_y &y, const T_dof &nu, const T_scale &s) |
| The CDF of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter. More... | |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | scaled_inv_chi_square_cdf_log (const T_y &y, const T_dof &nu, const T_scale &s) |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | scaled_inv_chi_square_lccdf (const T_y &y, const T_dof &nu, const T_scale &s) |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | scaled_inv_chi_square_lcdf (const T_y &y, const T_dof &nu, const T_scale &s) |
| template<bool propto, typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | scaled_inv_chi_square_log (const T_y &y, const T_dof &nu, const T_scale &s) |
| The log of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter. More... | |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | scaled_inv_chi_square_log (const T_y &y, const T_dof &nu, const T_scale &s) |
| template<bool propto, typename T_y , typename T_dof , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof, T_scale > * = nullptr> | |
| return_type_t< T_y, T_dof, T_scale > | scaled_inv_chi_square_lpdf (const T_y &y, const T_dof &nu, const T_scale &s) |
| The log of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter. More... | |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | scaled_inv_chi_square_lpdf (const T_y &y, const T_dof &nu, const T_scale &s) |
| template<typename T_deg , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_deg, T_scale >::type | scaled_inv_chi_square_rng (const T_deg &nu, const T_scale &s, RNG &rng) |
| Return a scaled chi square random variate for the given number of degrees of freedom and scale using the specified random number generator. More... | |
| template<typename T_y , typename T_loc , typename T_scale , typename T_skewness > | |
| return_type_t< T_y, T_loc, T_scale, T_skewness > | skew_double_exponential_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_skewness > | skew_double_exponential_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau) |
| Returns the skew double exponential cumulative density function. More... | |
| template<typename T_y , typename T_loc , typename T_scale , typename T_skewness > | |
| return_type_t< T_y, T_loc, T_scale, T_skewness > | skew_double_exponential_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_skewness > | skew_double_exponential_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau) |
| Returns the skew double exponential log complementary cumulative density function. More... | |
| template<typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_skewness > | skew_double_exponential_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau) |
| Returns the skew double exponential log cumulative density function. More... | |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_skewness > | |
| return_type_t< T_y, T_loc, T_scale, T_skewness > | skew_double_exponential_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_skewness > | |
| return_type_t< T_y, T_loc, T_scale, T_skewness > | skew_double_exponential_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_skewness > | skew_double_exponential_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau) |
| Returns the skew double exponential log probability density function. More... | |
| template<typename T_y , typename T_loc , typename T_scale , typename T_skewness > | |
| return_type_t< T_y, T_loc, T_scale, T_skewness > | skew_double_exponential_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau) |
| template<typename T_loc , typename T_scale , typename T_skewness , class RNG > | |
| VectorBuilder< true, double, T_loc, T_scale, T_skewness >::type | skew_double_exponential_rng (const T_loc &mu, const T_scale &sigma, const T_skewness &tau, RNG &rng) |
| Return a skew double exponential random variate with the given location scale and skewness using the specified random number generator. More... | |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | skew_normal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | skew_normal_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | skew_normal_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | skew_normal_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | skew_normal_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | skew_normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | skew_normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_shape > * = nullptr> | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | skew_normal_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha) |
| template<typename T_y , typename T_loc , typename T_scale , typename T_shape > | |
| return_type_t< T_y, T_loc, T_scale, T_shape > | skew_normal_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha) |
| template<typename T_loc , typename T_scale , typename T_shape , class RNG > | |
| VectorBuilder< true, double, T_loc, T_scale, T_shape >::type | skew_normal_rng (const T_loc &mu, const T_scale &sigma, const T_shape &alpha, RNG &rng) |
| Return a Skew-normal random variate for the given location, scale, and shape using the specified random number generator. More... | |
| template<typename T_y > | |
| return_type_t< T_y > | std_normal_ccdf_log (const T_y &y) |
| template<typename T_y , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y > * = nullptr> | |
| return_type_t< T_y > | std_normal_cdf (const T_y &y) |
| Calculates the standard normal cumulative distribution function for the given variate. More... | |
| template<typename T_y > | |
| return_type_t< T_y > | std_normal_cdf_log (const T_y &y) |
| template<typename T_y , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y > * = nullptr> | |
| return_type_t< T_y > | std_normal_lccdf (const T_y &y) |
| template<typename T_y , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y > * = nullptr> | |
| return_type_t< T_y > | std_normal_lcdf (const T_y &y) |
| template<bool propto, typename T_y > | |
| return_type_t< T_y > | std_normal_log (const T_y &y) |
| The log of a standard normal density for the specified scalar(s). More... | |
| template<typename T_y > | |
| return_type_t< T_y > | std_normal_log (const T_y &y) |
| template<bool propto, typename T_y , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y > * = nullptr> | |
| return_type_t< T_y > | std_normal_lpdf (const T_y &y) |
| The log of the normal density for the specified scalar(s) given a location of 0 and a scale of 1. More... | |
| template<typename T_y > | |
| return_type_t< T_y > | std_normal_lpdf (const T_y &y) |
| template<class RNG > | |
| double | std_normal_rng (RNG &rng) |
| Return a standard Normal random variate using the specified random number generator. More... | |
| template<typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | student_t_ccdf_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | student_t_cdf (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | student_t_cdf_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | student_t_lccdf (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma) |
| template<typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | student_t_lcdf (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | student_t_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma) |
| The log of the Student-t density for the given y, nu, mean, and scale parameter. More... | |
| template<typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | student_t_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof, T_loc, T_scale > * = nullptr> | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | student_t_lpdf (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma) |
| The log of the Student-t density for the given y, nu, mean, and scale parameter. More... | |
| template<typename T_y , typename T_dof , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_dof, T_loc, T_scale > | student_t_lpdf (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma) |
| template<typename T_deg , typename T_loc , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_deg, T_loc, T_scale >::type | student_t_rng (const T_deg &nu, const T_loc &mu, const T_scale &sigma, RNG &rng) |
| Return a student-t random variate for the given degrees of freedom, location, and scale using the specified random number generator. More... | |
| template<typename T_y , typename T_low , typename T_high > | |
| return_type_t< T_y, T_low, T_high > | uniform_ccdf_log (const T_y &y, const T_low &alpha, const T_high &beta) |
| template<typename T_y , typename T_low , typename T_high , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_low, T_high > * = nullptr> | |
| return_type_t< T_y, T_low, T_high > | uniform_cdf (const T_y &y, const T_low &alpha, const T_high &beta) |
| template<typename T_y , typename T_low , typename T_high > | |
| return_type_t< T_y, T_low, T_high > | uniform_cdf_log (const T_y &y, const T_low &alpha, const T_high &beta) |
| template<typename T_y , typename T_low , typename T_high , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_low, T_high > * = nullptr> | |
| return_type_t< T_y, T_low, T_high > | uniform_lccdf (const T_y &y, const T_low &alpha, const T_high &beta) |
| template<typename T_y , typename T_low , typename T_high , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_low, T_high > * = nullptr> | |
| return_type_t< T_y, T_low, T_high > | uniform_lcdf (const T_y &y, const T_low &alpha, const T_high &beta) |
| template<bool propto, typename T_y , typename T_low , typename T_high > | |
| return_type_t< T_y, T_low, T_high > | uniform_log (const T_y &y, const T_low &alpha, const T_high &beta) |
| The log of a uniform density for the given y, lower, and upper bound. More... | |
| template<typename T_y , typename T_low , typename T_high > | |
| return_type_t< T_y, T_low, T_high > | uniform_log (const T_y &y, const T_low &alpha, const T_high &beta) |
| template<bool propto, typename T_y , typename T_low , typename T_high , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_low, T_high > * = nullptr> | |
| return_type_t< T_y, T_low, T_high > | uniform_lpdf (const T_y &y, const T_low &alpha, const T_high &beta) |
| The log of a uniform density for the given y, lower, and upper bound. More... | |
| template<typename T_y , typename T_low , typename T_high > | |
| return_type_t< T_y, T_low, T_high > | uniform_lpdf (const T_y &y, const T_low &alpha, const T_high &beta) |
| template<typename T_alpha , typename T_beta , class RNG > | |
| VectorBuilder< true, double, T_alpha, T_beta >::type | uniform_rng (const T_alpha &alpha, const T_beta &beta, RNG &rng) |
| Return a uniform random variate for the given upper and lower bounds using the specified random number generator. More... | |
| template<typename T_x , typename T_mu , typename T_k > | |
| return_type_t< T_x, T_mu, T_k > | von_mises_cdf (const T_x &x, const T_mu &mu, const T_k &k) |
| Calculates the cumulative distribution function of the von Mises distribution: More... | |
| template<typename T_x , typename T_mu , typename T_k > | |
| return_type_t< T_x, T_mu, T_k > | von_mises_lccdf (const T_x &x, const T_mu &mu, const T_k &k) |
| Calculates the log of the complement of the cumulative distribution function of the von Mises distribution: More... | |
| template<typename T_x , typename T_mu , typename T_k > | |
| return_type_t< T_x, T_mu, T_k > | von_mises_lcdf (const T_x &x, const T_mu &mu, const T_k &k) |
| Calculates the log of the cumulative distribution function of the von Mises distribution: More... | |
| template<bool propto, typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | von_mises_log (T_y const &y, T_loc const &mu, T_scale const &kappa) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | von_mises_log (T_y const &y, T_loc const &mu, T_scale const &kappa) |
| template<bool propto, typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | von_mises_lpdf (T_y const &y, T_loc const &mu, T_scale const &kappa) |
| template<typename T_y , typename T_loc , typename T_scale > | |
| return_type_t< T_y, T_loc, T_scale > | von_mises_lpdf (T_y const &y, T_loc const &mu, T_scale const &kappa) |
| template<typename T_loc , typename T_conc , class RNG > | |
| VectorBuilder< true, double, T_loc, T_conc >::type | von_mises_rng (const T_loc &mu, const T_conc &kappa, RNG &rng) |
| Return a von Mises random variate for the given location and concentration using the specified random number generator. More... | |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | weibull_ccdf_log (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr> | |
| return_type_t< T_y, T_shape, T_scale > | weibull_cdf (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| Returns the Weibull cumulative distribution function for the given location and scale. More... | |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | weibull_cdf_log (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr> | |
| return_type_t< T_y, T_shape, T_scale > | weibull_lccdf (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| Returns the Weibull log complementary cumulative distribution function for the given location and scale. More... | |
| template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr> | |
| return_type_t< T_y, T_shape, T_scale > | weibull_lcdf (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| Returns the Weibull log cumulative distribution function for the given location and scale. More... | |
| template<bool propto, typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | weibull_log (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | weibull_log (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<bool propto, typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr> | |
| return_type_t< T_y, T_shape, T_scale > | weibull_lpdf (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| Returns the Weibull log probability density for the given location and scale. More... | |
| template<typename T_y , typename T_shape , typename T_scale > | |
| return_type_t< T_y, T_shape, T_scale > | weibull_lpdf (const T_y &y, const T_shape &alpha, const T_scale &sigma) |
| template<typename T_shape , typename T_scale , class RNG > | |
| VectorBuilder< true, double, T_shape, T_scale >::type | weibull_rng (const T_shape &alpha, const T_scale &sigma, RNG &rng) |
| Return a Weibull random variate for the given shape and scale parameters using the specified random number generator. More... | |
| template<bool propto, typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta > | |
| return_type_t< T_y, T_alpha, T_tau, T_beta, T_delta > | wiener_log (const T_y &y, const T_alpha &alpha, const T_tau &tau, const T_beta &beta, const T_delta &delta) |
| The log of the first passage time density function for a (Wiener) drift diffusion model for the given \(y\), boundary separation \(\alpha\), nondecision time \(\tau\), relative bias \(\beta\), and drift rate \(\delta\). More... | |
| template<typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta > | |
| return_type_t< T_y, T_alpha, T_tau, T_beta, T_delta > | wiener_log (const T_y &y, const T_alpha &alpha, const T_tau &tau, const T_beta &beta, const T_delta &delta) |
| template<bool propto, typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta > | |
| return_type_t< T_y, T_alpha, T_tau, T_beta, T_delta > | wiener_lpdf (const T_y &y, const T_alpha &alpha, const T_tau &tau, const T_beta &beta, const T_delta &delta) |
| The log of the first passage time density function for a (Wiener) drift diffusion model for the given \(y\), boundary separation \(\alpha\), nondecision time \(\tau\), relative bias \(\beta\), and drift rate \(\delta\). More... | |
| template<typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta > | |
| return_type_t< T_y, T_alpha, T_tau, T_beta, T_delta > | wiener_lpdf (const T_y &y, const T_alpha &alpha, const T_tau &tau, const T_beta &beta, const T_delta &delta) |
| template<bool propto, typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | wishart_log (const T_y &W, const T_dof &nu, const T_scale &S) |
| The log of the Wishart density for the given W, degrees of freedom, and scale matrix. More... | |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | wishart_log (const T_y &W, const T_dof &nu, const T_scale &S) |
| template<bool propto, typename T_y , typename T_dof , typename T_scale , require_stan_scalar_t< T_dof > * = nullptr, require_all_matrix_t< T_y, T_scale > * = nullptr> | |
| return_type_t< T_y, T_dof, T_scale > | wishart_lpdf (const T_y &W, const T_dof &nu, const T_scale &S) |
| The log of the Wishart density for the given W, degrees of freedom, and scale matrix. More... | |
| template<typename T_y , typename T_dof , typename T_scale > | |
| return_type_t< T_y, T_dof, T_scale > | wishart_lpdf (const T_y &W, const T_dof &nu, const T_scale &S) |
| template<class RNG > | |
| Eigen::MatrixXd | wishart_rng (double nu, const Eigen::MatrixXd &S, RNG &rng) |
| template<typename... Pargs> | |
| double * | accumulate_adjoints (double *dest, const var &x, Pargs &&...args) |
| Accumulate adjoints from x into storage pointed to by dest, increment the adjoint storage pointer, recursively accumulate the adjoints of the rest of the arguments, and return final position of storage pointer. More... | |
| template<typename VarVec , require_std_vector_vt< is_var, VarVec > * = nullptr, typename... Pargs> | |
| double * | accumulate_adjoints (double *dest, VarVec &&x, Pargs &&...args) |
| Accumulate adjoints from std::vector x into storage pointed to by dest, increment the adjoint storage pointer, recursively accumulate the adjoints of the rest of the arguments, and return final position of storage pointer. More... | |
| template<typename VecContainer , require_std_vector_st< is_var, VecContainer > * = nullptr, require_std_vector_vt< is_container, VecContainer > * = nullptr, typename... Pargs> | |
| double * | accumulate_adjoints (double *dest, VecContainer &&x, Pargs &&...args) |
| Accumulate adjoints from x (a std::vector of containers containing vars) into storage pointed to by dest, increment the adjoint storage pointer, recursively accumulate the adjoints of the rest of the arguments, and return final position of storage pointer. More... | |
| template<typename EigT , require_eigen_vt< is_var, EigT > * = nullptr, typename... Pargs> | |
| double * | accumulate_adjoints (double *dest, EigT &&x, Pargs &&...args) |
| Accumulate adjoints from x (an Eigen type containing vars) into storage pointed to by dest, increment the adjoint storage pointer, recursively accumulate the adjoints of the rest of the arguments, and return final position of storage pointer. More... | |
| template<typename Arith , require_st_arithmetic< Arith > * = nullptr, typename... Pargs> | |
| double * | accumulate_adjoints (double *dest, Arith &&x, Pargs &&...args) |
| Ignore arithmetic types. More... | |
| double * | accumulate_adjoints (double *dest) |
| End accumulate_adjoints recursion and return pointer. More... | |
| template<int R, int C> | |
| vari ** | build_vari_array (const Eigen::Matrix< var, R, C > &x) |
| Allocates and populates a flat array of vari pointers in the autodiff arena with the varis pointed to by the vars in the input Eigen matrix. More... | |
| template<typename T , typename F > | |
| internal::callback_vari< plain_type_t< T >, F > * | make_callback_vari (T &&value, F &&functor) |
| Creates a new vari with given value and a callback that implements the reverse pass (chain). More... | |
| template<typename T , typename F > | |
| var_value< plain_type_t< T > > | make_callback_var (T &&value, F &&functor) |
| Creates a new var initialized with a callback_vari with a given value and reverse-pass callback functor. More... | |
| template<typename T > | |
| auto | make_chainable_ptr (T &&obj) |
Store the given object in a chainable_object so it is destructed only when the chainable stack memory is recovered and return a pointer to the underlying object. More... | |
| template<typename T > | |
| auto | make_unsafe_chainable_ptr (T &&obj) |
Store the given object in a chainable_object so it is destructed only when the chainable stack memory is recovered and return a pointer to the underlying object This function differs from make_chainable_object in that this class does not evaluate expressions. More... | |
| template<typename... Pargs> | |
| size_t | count_vars (Pargs &&...args) |
| Count the number of vars in the input argument list. More... | |
| template<typename Arith , typename = require_arithmetic_t<scalar_type_t<Arith>>> | |
| Arith | deep_copy_vars (Arith &&arg) |
| Forward arguments that do not contain vars. More... | |
| auto | deep_copy_vars (const var &arg) |
| Copy the value of a var but reallocate a new vari. More... | |
| template<typename VarVec , require_std_vector_vt< is_var, VarVec > * = nullptr> | |
| auto | deep_copy_vars (VarVec &&arg) |
| Copy the vars in arg but reallocate new varis for them. More... | |
| template<typename VecContainer , require_std_vector_st< is_var, VecContainer > * = nullptr, require_std_vector_vt< is_container, VecContainer > * = nullptr> | |
| auto | deep_copy_vars (VecContainer &&arg) |
| Copy the vars in arg but reallocate new varis for them. More... | |
| template<typename EigT , require_eigen_vt< is_var, EigT > * = nullptr> | |
| auto | deep_copy_vars (EigT &&arg) |
| Copy the vars in arg but reallocate new varis for them. More... | |
| static bool | empty_nested () |
| Return true if there is no nested autodiff being executed. More... | |
| static void | grad () |
| Compute the gradient for all variables starting from the end of the AD tape. More... | |
| template<typename Vari > | |
| static void | grad (Vari *vi) |
| Compute the gradient for all variables starting from the specified root variable implementation. More... | |
| static size_t | nested_size () |
| var | operator+ (const var &a, const var &b) |
| Addition operator for variables (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| var | operator+ (const var &a, Arith b) |
| Addition operator for variable and scalar (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| var | operator+ (Arith a, const var &b) |
| Addition operator for scalar and variable (C++). More... | |
| template<typename VarMat1 , typename VarMat2 , require_all_rev_matrix_t< VarMat1, VarMat2 > * = nullptr> | |
| auto | add (const VarMat1 &a, const VarMat2 &b) |
| Addition operator for matrix variables (C++). More... | |
| template<typename Arith , typename VarMat , require_st_arithmetic< Arith > * = nullptr, require_rev_matrix_t< VarMat > * = nullptr> | |
| auto | add (const VarMat &a, const Arith &b) |
| Addition operator for a matrix variable and arithmetic (C++). More... | |
| template<typename Arith , typename VarMat , require_st_arithmetic< Arith > * = nullptr, require_rev_matrix_t< VarMat > * = nullptr> | |
| auto | add (const Arith &a, const VarMat &b) |
| Addition operator for an arithmetic type and matrix variable (C++). More... | |
| template<typename Var , typename EigMat , require_var_vt< std::is_arithmetic, Var > * = nullptr, require_eigen_vt< std::is_arithmetic, EigMat > * = nullptr> | |
| auto | add (const Var &a, const EigMat &b) |
| Addition operator for an arithmetic matrix and variable (C++). More... | |
| template<typename EigMat , typename Var , require_eigen_vt< std::is_arithmetic, EigMat > * = nullptr, require_var_vt< std::is_arithmetic, Var > * = nullptr> | |
| auto | add (const EigMat &a, const Var &b) |
| Addition operator for a variable and arithmetic matrix (C++). More... | |
| template<typename Var , typename VarMat , require_var_vt< std::is_arithmetic, Var > * = nullptr, require_rev_matrix_t< VarMat > * = nullptr> | |
| auto | add (const Var &a, const VarMat &b) |
| Addition operator for a variable and variable matrix (C++). More... | |
| template<typename Var , typename VarMat , require_var_vt< std::is_arithmetic, Var > * = nullptr, require_rev_matrix_t< VarMat > * = nullptr> | |
| auto | add (const VarMat &a, const Var &b) |
| Addition operator for a variable matrix and variable (C++). More... | |
| template<typename T1 , typename T2 , require_any_var_vt< std::is_arithmetic, T1, T2 > * = nullptr, require_any_arithmetic_t< T1, T2 > * = nullptr> | |
| auto | add (const T1 &a, const T2 &b) |
| template<typename T1 , typename T2 , require_all_var_vt< std::is_arithmetic, T1, T2 > * = nullptr> | |
| auto | add (const T1 &a, const T2 &b) |
| template<typename VarMat1 , typename VarMat2 , require_any_var_matrix_t< VarMat1, VarMat2 > * = nullptr> | |
| auto | operator+ (const VarMat1 &a, const VarMat2 &b) |
| Addition operator for matrix variables. More... | |
| var | operator/ (const var ÷nd, const var &divisor) |
| Division operator for two variables (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| var | operator/ (const var ÷nd, Arith divisor) |
| Division operator for dividing a variable by a scalar (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| var | operator/ (Arith dividend, const var &divisor) |
| Division operator for dividing a scalar by a variable (C++). More... | |
| template<typename Scalar , typename Mat , require_matrix_t< Mat > * = nullptr, require_stan_scalar_t< Scalar > * = nullptr, require_all_st_var_or_arithmetic< Scalar, Mat > * = nullptr, require_any_st_var< Scalar, Mat > * = nullptr> | |
| auto | divide (const Mat &m, Scalar c) |
| Return matrix divided by scalar. More... | |
| template<typename Scalar , typename Mat , require_matrix_t< Mat > * = nullptr, require_stan_scalar_t< Scalar > * = nullptr, require_all_st_var_or_arithmetic< Scalar, Mat > * = nullptr, require_any_st_var< Scalar, Mat > * = nullptr> | |
| auto | divide (Scalar c, const Mat &m) |
| Return scalar divided by matrix. More... | |
| template<typename Mat1 , typename Mat2 , require_all_matrix_st< is_var_or_arithmetic, Mat1, Mat2 > * = nullptr, require_any_matrix_st< is_var, Mat1, Mat2 > * = nullptr> | |
| auto | divide (const Mat1 &m1, const Mat2 &m2) |
| Return a matrix divided by a matrix elementwise. More... | |
| template<typename T1 , typename T2 , require_any_var_matrix_t< T1, T2 > * = nullptr> | |
| auto | operator/ (const T1 ÷nd, const T2 &divisor) |
| std::complex< var > | operator/ (const std::complex< var > &x1, const std::complex< var > &x2) |
| bool | operator== (const var &a, const var &b) |
| Equality operator comparing two variables' values (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator== (const var &a, Arith b) |
| Equality operator comparing a variable's value and a double (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator== (Arith a, const var &b) |
| Equality operator comparing a scalar and a variable's value (C++). More... | |
| bool | operator== (const var &x, const std::complex< var > &z) |
Return true if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero. More... | |
| bool | operator== (const std::complex< var > &z, const var &y) |
Return true if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero. More... | |
| bool | operator> (const var &a, const var &b) |
| Greater than operator comparing variables' values (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator> (const var &a, Arith b) |
| Greater than operator comparing variable's value and double (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator> (Arith a, const var &b) |
| Greater than operator comparing a double and a variable's value (C++). More... | |
| bool | operator>= (const var &a, const var &b) |
| Greater than or equal operator comparing two variables' values (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator>= (const var &a, Arith b) |
| Greater than or equal operator comparing variable's value and double (C++). More... | |
| template<typename Arith , typename Var , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator>= (Arith a, const var &b) |
| Greater than or equal operator comparing double and variable's value (C++). More... | |
| bool | operator< (const var &a, const var &b) |
| Less than operator comparing variables' values (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator< (const var &a, Arith b) |
| Less than operator comparing variable's value and a double (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator< (Arith a, const var &b) |
| Less than operator comparing a double and variable's value (C++). More... | |
| bool | operator<= (const var &a, const var &b) |
| Less than or equal operator comparing two variables' values (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator<= (const var &a, Arith b) |
| Less than or equal operator comparing a variable's value and a scalar (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator<= (Arith a, const var &b) |
| Less than or equal operator comparing a double and variable's value (C++). More... | |
| bool | operator&& (const var &x, const var &y) |
Return the logical conjunction of the values of the two arguments as defined by &&. More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator&& (const var &x, Arith y) |
Return the logical conjunction of the values of the two arguments as defined by &&. More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator&& (Arith x, const var &y) |
Return the logical conjunction of the values of the two arguments as defined by &&. More... | |
| bool | operator|| (const var &x, const var &y) |
Return the logical disjunction of the values of the two arguments as defined by ||. More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator|| (const var &x, Arith y) |
Return the logical disjunction of the values of the two arguments as defined by ||. More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator|| (Arith x, const var &y) |
Return the logical disjunction of the values of the two arguments as defined by ||. More... | |
| var | operator* (const var &a, const var &b) |
| Multiplication operator for two variables (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| var | operator* (const var &a, Arith b) |
| Multiplication operator for a variable and a scalar (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| var | operator* (Arith a, const var &b) |
| Multiplication operator for a scalar and a variable (C++). More... | |
| bool | operator!= (const var &a, const var &b) |
| Inequality operator comparing two variables' values (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator!= (const var &a, Arith b) |
| Inequality operator comparing a variable's value and a double (C++). More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| bool | operator!= (Arith a, const var &b) |
| Inequality operator comparing a double and a variable's value (C++). More... | |
| bool | operator!= (const var &x, const std::complex< var > &z) |
Return false if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero. More... | |
| bool | operator!= (const std::complex< var > &z, const var &y) |
Return false if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero. More... | |
| var | operator- (const var &a, const var &b) |
| Subtraction operator for variables. More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| var | operator- (const var &a, Arith b) |
| Subtraction operator for variable and scalar. More... | |
| template<typename Arith , require_arithmetic_t< Arith > * = nullptr> | |
| var | operator- (Arith a, const var &b) |
| Subtraction operator for scalar and variable. More... | |
| template<typename VarMat1 , typename VarMat2 , require_all_rev_matrix_t< VarMat1, VarMat2 > * = nullptr> | |
| auto | subtract (const VarMat1 &a, const VarMat2 &b) |
| Subtraction operator for matrix variables. More... | |
| template<typename Arith , typename VarMat , require_st_arithmetic< Arith > * = nullptr, require_rev_matrix_t< VarMat > * = nullptr> | |
| auto | subtract (const VarMat &a, const Arith &b) |
| Subtraction operator for a matrix variable and arithmetic. More... | |
| template<typename Arith , typename VarMat , require_st_arithmetic< Arith > * = nullptr, require_rev_matrix_t< VarMat > * = nullptr> | |
| auto | subtract (const Arith &a, const VarMat &b) |
| Subtraction operator for an arithmetic type and matrix variable. More... | |
| template<typename Var , typename EigMat , require_var_vt< std::is_arithmetic, Var > * = nullptr, require_eigen_vt< std::is_arithmetic, EigMat > * = nullptr> | |
| auto | subtract (const Var &a, const EigMat &b) |
| Subtraction operator for an arithmetic matrix and variable. More... | |
| template<typename EigMat , typename Var , require_eigen_vt< std::is_arithmetic, EigMat > * = nullptr, require_var_vt< std::is_arithmetic, Var > * = nullptr> | |
| auto | subtract (const EigMat &a, const Var &b) |
| Subtraction operator for a variable and arithmetic matrix. More... | |
| template<typename Var , typename VarMat , require_var_vt< std::is_arithmetic, Var > * = nullptr, require_rev_matrix_t< VarMat > * = nullptr> | |
| auto | subtract (const Var &a, const VarMat &b) |
| Subtraction operator for a variable and variable matrix. More... | |
| template<typename Var , typename VarMat , require_rev_matrix_t< VarMat > * = nullptr, require_var_vt< std::is_arithmetic, Var > * = nullptr> | |
| auto | subtract (const VarMat &a, const Var &b) |
| Subtraction operator for a variable matrix and variable. More... | |
| template<typename T1 , typename T2 , require_any_var_vt< std::is_arithmetic, T1, T2 > * = nullptr, require_any_arithmetic_t< T1, T2 > * = nullptr> | |
| auto | subtract (const T1 &a, const T2 &b) |
| template<typename T1 , typename T2 , require_all_var_vt< std::is_arithmetic, T1, T2 > * = nullptr> | |
| auto | subtract (const T1 &a, const T2 &b) |
| template<typename VarMat1 , typename VarMat2 , require_any_var_matrix_t< VarMat1, VarMat2 > * = nullptr> | |
| auto | operator- (const VarMat1 &a, const VarMat2 &b) |
| Addition operator for matrix variables. More... | |
| var & | operator-- (var &a) |
| Prefix decrement operator for variables (C++). More... | |
| var | operator-- (var &a, int) |
| Postfix decrement operator for variables (C++). More... | |
| var & | operator++ (var &a) |
| Prefix increment operator for variables (C++). More... | |
| var | operator++ (var &a, int) |
| Postfix increment operator for variables (C++). More... | |
| var | operator- (const var &a) |
| Unary negation operator for variables (C++). More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | operator- (const T &a) |
| Compute additive inverse of input. More... | |
| bool | operator! (const var &x) |
Return the negation of the value of the argument as defined by !. More... | |
| var | operator+ (const var &a) |
| Unary plus operator for variables (C++). More... | |
| template<typename Arith , typename VecVar , typename VecArith , typename... ContainerOperands, typename... ContainerGradients> | |
| var | precomputed_gradients (Arith value, const VecVar &operands, const VecArith &gradients, const std::tuple< ContainerOperands... > &container_operands=std::tuple<>(), const std::tuple< ContainerGradients... > &container_gradients=std::tuple<>()) |
| This function returns a var for an expression that has the specified value, vector of operands, and vector of partial derivatives of value with respect to the operands. More... | |
| void | print_stack (std::ostream &o) |
| Prints the autodiff variable stack. More... | |
| template<typename EigVar , typename EigVari , typename EigDbl > | |
| void | read_vi_val_adj (const EigVar &VarMat, EigVari &VariMat, EigDbl &ValMat, EigDbl &AdjMat) |
| Function applying the vi_val_adj_functor to extract the vari*, values, and adjoints of a given var matrix into separate matrices. More... | |
| template<typename EigRev , typename EigDbl > | |
| void | read_val_adj (const EigRev &VarMat, EigDbl &ValMat, EigDbl &AdjMat) |
| Function applying the val_adj_functor to extract the values and adjoints of a given var or vari matrix into separate matrices. More... | |
| template<typename EigVar , typename EigVari , typename EigDbl > | |
| void | read_vi_val (const EigVar &VarMat, EigVari &VariMat, EigDbl &ValMat) |
| Function applying the vi_val_functor to extract the varis and and values of a given var matrix into separate matrices. More... | |
| template<typename EigVar , typename EigVari , typename EigDbl > | |
| void | read_vi_adj (const EigVar &VarMat, EigVari &VariMat, EigDbl &AdjMat) |
| Function applying the vi_adj_functor to extract the varis and and adjoints of a given var matrix into separate matrices. More... | |
| static void | recover_memory () |
| Recover memory used for all variables for reuse. More... | |
| static void | recover_memory_nested () |
| Recover only the memory used for the top nested call. More... | |
| template<typename F > | |
| void | reverse_pass_callback (F &&functor) |
| Puts a callback on the autodiff stack to be called in reverse pass. More... | |
| template<typename... Pargs> | |
| vari ** | save_varis (vari **dest, const var &x, Pargs &&...args) |
| Save the vari pointer in x into the memory pointed to by dest, increment the dest storage pointer, recursively call save_varis on the rest of the arguments, and return the final value of the dest storage pointer. More... | |
| template<typename VarVec , require_std_vector_vt< is_var, VarVec > * = nullptr, typename... Pargs> | |
| vari ** | save_varis (vari **dest, VarVec &&x, Pargs &&...args) |
| Save the vari pointers in x into the memory pointed to by dest, increment the dest storage pointer, recursively call save_varis on the rest of the arguments, and return the final value of the dest storage pointer. More... | |
| template<typename VecContainer , require_std_vector_st< is_var, VecContainer > * = nullptr, require_std_vector_vt< is_container, VecContainer > * = nullptr, typename... Pargs> | |
| vari ** | save_varis (vari **dest, VecContainer &&x, Pargs &&...args) |
| Save the vari pointers in x into the memory pointed to by dest, increment the dest storage pointer, recursively call save_varis on the rest of the arguments, and return the final value of the dest storage pointer. More... | |
| template<typename EigT , require_eigen_vt< is_var, EigT > * = nullptr, typename... Pargs> | |
| vari ** | save_varis (vari **dest, EigT &&x, Pargs &&...args) |
| Save the vari pointers in x into the memory pointed to by dest, increment the dest storage pointer, recursively call save_varis on the rest of the arguments, and return the final value of the dest storage pointer. More... | |
| template<typename Arith , require_st_arithmetic< Arith > * = nullptr, typename... Pargs> | |
| vari ** | save_varis (vari **dest, Arith &&x, Pargs &&...args) |
| Ignore arithmetic types. More... | |
| vari ** | save_varis (vari **dest) |
| End save_varis recursion and return pointer. More... | |
| static void | set_zero_all_adjoints () |
| Reset all adjoint values in the stack to zero. More... | |
| static void | set_zero_all_adjoints_nested () |
| Reset all adjoint values in the top nested portion of the stack to zero. More... | |
| static void | start_nested () |
Record the current position so that recover_memory_nested() can find it. More... | |
| template<typename Vari > | |
| static void | grad (Vari *vi) |
| void | zero_adjoints () noexcept |
| End of recursion for set_zero_adjoints. More... | |
| template<typename T , require_st_arithmetic< T > * = nullptr> | |
| void | zero_adjoints (T &x) noexcept |
| Do nothing for non-autodiff arguments. More... | |
| void | zero_adjoints (var &x) |
| Zero the adjoint of the vari in the first argument. More... | |
| template<typename EigMat , require_eigen_vt< is_autodiff, EigMat > * = nullptr> | |
| void | zero_adjoints (EigMat &x) |
| Zero the adjoints of the varis of every var in an Eigen::Matrix container. More... | |
| template<typename StdVec , require_std_vector_st< is_autodiff, StdVec > * = nullptr> | |
| void | zero_adjoints (StdVec &x) |
| Zero the adjoints of every element in a vector. More... | |
| template<typename T > | |
| auto | abs (const var_value< T > &a) |
| Return the absolute value of the variable (std). More... | |
| var | abs (const std::complex< var > &z) |
| Return the absolute value of the complex argument. More... | |
| var | acos (const var &x) |
| Return the principal value of the arc cosine of a variable, in radians (cmath). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | acos (const VarMat &x) |
| Return the principal value of the arc cosine of a variable, in radians (cmath). More... | |
| std::complex< var > | acos (const std::complex< var > &x) |
| Return the arc cosine of the complex argument. More... | |
| var | acosh (const var &x) |
| The inverse hyperbolic cosine function for variables (C99). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | acosh (const VarMat &x) |
| The inverse hyperbolic cosine function for variables (C99). More... | |
| std::complex< var > | acosh (const std::complex< var > &z) |
| Return the hyperbolic arc cosine of the complex argument. More... | |
| template<typename T , require_var_t< T > * = nullptr> | |
| auto & | adjoint_of (const T &x) |
| Returns a reference to a variable's adjoint. More... | |
| template<typename T , require_not_var_t< T > * = nullptr> | |
| internal::nonexisting_adjoint | adjoint_of (const T &x) |
| Returns a reference to a variable's adjoint. More... | |
| template<typename Scal , typename RowVec , require_stan_scalar_t< Scal > * = nullptr, require_t< is_eigen_row_vector< RowVec >> * = nullptr> | |
| auto | append_col (const Scal &A, const var_value< RowVec > &B) |
| Return the result of stacking an scalar on top of the a row vector, with the result being a row vector. More... | |
| template<typename RowVec , typename Scal , require_t< is_eigen_row_vector< RowVec >> * = nullptr, require_stan_scalar_t< Scal > * = nullptr> | |
| auto | append_col (const var_value< RowVec > &A, const Scal &B) |
| Return the result of stacking a row vector on top of the an scalar, with the result being a row vector. More... | |
| template<typename Scal , typename ColVec , require_stan_scalar_t< Scal > * = nullptr, require_t< is_eigen_col_vector< ColVec >> * = nullptr> | |
| auto | append_row (const Scal &A, const var_value< ColVec > &B) |
| Return the result of stacking an scalar on top of the a vector, with the result being a vector. More... | |
| template<typename ColVec , typename Scal , require_t< is_eigen_col_vector< ColVec >> * = nullptr, require_stan_scalar_t< Scal > * = nullptr> | |
| auto | append_row (const var_value< ColVec > &A, const Scal &B) |
| Return the result of stacking a vector on top of the an scalar, with the result being a vector. More... | |
| var | arg (const std::complex< var > &z) |
| Return the phase angle of the complex argument. More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | as_array_or_scalar (T &&v) |
Converts a var_value<T> with inner Eigen matrix type to an var_value<T> with an inner array. More... | |
| int | as_bool (const var &v) |
| Return 1 if the argument is unequal to zero and 0 otherwise. More... | |
| var | asin (const var &x) |
| Return the principal value of the arc sine, in radians, of the specified variable (cmath). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | asin (const VarMat &x) |
| Return the principal value of the arc sine, in radians, of the specified variable (cmath). More... | |
| std::complex< var > | asin (const std::complex< var > &z) |
| Return the arc sine of the complex argument. More... | |
| var | asinh (const var &x) |
| The inverse hyperbolic sine function for variables (C99). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | asinh (const VarMat &x) |
| The inverse hyperbolic sine function for variables (C99). More... | |
| std::complex< var > | asinh (const std::complex< var > &z) |
| Return the hyperbolic arcsine of the complex argument. More... | |
| var | atan (const var &x) |
| Return the principal value of the arc tangent, in radians, of the specified variable (cmath). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | atan (const VarMat &x) |
| Return the principal value of the arc tangent, in radians, of the specified variable (cmath). More... | |
| std::complex< var > | atan (const std::complex< var > &z) |
| Return the arc tangent of the complex argument. More... | |
| var | atan2 (const var &a, const var &b) |
| Return the principal value of the arc tangent, in radians, of the first variable divided by the second (cmath). More... | |
| var | atan2 (const var &a, double b) |
| Return the principal value of the arc tangent, in radians, of the first variable divided by the second scalar (cmath). More... | |
| var | atan2 (double a, const var &b) |
| Return the principal value of the arc tangent, in radians, of the first scalar divided by the second variable (cmath). More... | |
| var | atanh (const var &x) |
| The inverse hyperbolic tangent function for variables (C99). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | atanh (const VarMat &x) |
| The inverse hyperbolic tangent function for variables (C99). More... | |
| std::complex< var > | atanh (const std::complex< var > &z) |
| Return the hyperbolic arc tangent of the complex argument. More... | |
| var | bessel_first_kind (int v, const var &a) |
| template<typename T1 , typename T2 , require_st_integral< T1 > * = nullptr, require_eigen_t< T2 > * = nullptr> | |
| auto | bessel_first_kind (const T1 &v, const var_value< T2 > &a) |
Overload with var_value<Matrix> for int, std::vector<int>, and std::vector<std::vector<int>> More... | |
| var | bessel_second_kind (int v, const var &a) |
| template<typename T1 , typename T2 , require_st_integral< T1 > * = nullptr, require_eigen_t< T2 > * = nullptr> | |
| auto | bessel_second_kind (const T1 &v, const var_value< T2 > &a) |
Overload with var_value<Matrix> for int, std::vector<int>, and std::vector<std::vector<int>> More... | |
| var | beta (const var &a, const var &b) |
| Returns the beta function and gradients for two var inputs. More... | |
| var | beta (const var &a, double b) |
| Returns the beta function and gradient for first var input. More... | |
| var | beta (double a, const var &b) |
| Returns the beta function and gradient for second var input. More... | |
| template<typename Mat1 , typename Mat2 , require_any_var_matrix_t< Mat1, Mat2 > * = nullptr, require_all_matrix_t< Mat1, Mat2 > * = nullptr> | |
| auto | beta (const Mat1 &a, const Mat2 &b) |
| template<typename Scalar , typename VarMat , require_var_matrix_t< VarMat > * = nullptr, require_stan_scalar_t< Scalar > * = nullptr> | |
| auto | beta (const Scalar &a, const VarMat &b) |
| template<typename VarMat , typename Scalar , require_var_matrix_t< VarMat > * = nullptr, require_stan_scalar_t< Scalar > * = nullptr> | |
| auto | beta (const VarMat &a, const Scalar &b) |
| var | binary_log_loss (int y, const var &y_hat) |
| The log loss function for variables (stan). More... | |
| template<typename Mat , require_eigen_t< Mat > * = nullptr> | |
| auto | binary_log_loss (int y, const var_value< Mat > &y_hat) |
Overload with int and var_value<Matrix> More... | |
| template<typename StdVec , typename Mat , require_eigen_t< Mat > * = nullptr, require_st_integral< StdVec > * = nullptr> | |
| auto | binary_log_loss (const StdVec &y, const var_value< Mat > &y_hat) |
Overload with var_value<Matrix> for std::vector<int> and std::vector<std::vector<int>> More... | |
| var | cbrt (const var &a) |
| Returns the cube root of the specified variable (C99). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | cbrt (const VarMat &a) |
| Returns the cube root of the specified variable (C99). More... | |
| var | ceil (const var &a) |
| Return the ceiling of the specified variable (cmath). More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| auto | ceil (const var_value< T > &a) |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| var_value< Eigen::MatrixXd > | cholesky_corr_constrain (const T &y, int K) |
Return the Cholesky factor of the correlation matrix of the sepcified size read from the unconstrained vector y. More... | |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| var_value< Eigen::MatrixXd > | cholesky_corr_constrain (const T &y, int K, scalar_type_t< T > &lp) |
Return the Cholesky factor of the correlation matrix of the sepcified size read from the unconstrained vector y. More... | |
| template<typename EigMat , require_eigen_vt< is_var, EigMat > * = nullptr> | |
| auto | cholesky_decompose (const EigMat &A) |
| Reverse mode specialization of cholesky decomposition. More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | cholesky_decompose (const T &A) |
| Reverse mode specialization of Cholesky decomposition. More... | |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| var_value< Eigen::MatrixXd > | cholesky_factor_constrain (const T &x, int M, int N) |
| Return the Cholesky factor of the specified size read from the specified vector. More... | |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| var_value< Eigen::MatrixXd > | cholesky_factor_constrain (const T &x, int M, int N, scalar_type_t< T > &lp) |
| Return the Cholesky factor of the specified size read from the specified vector and increment the specified log probability reference with the log Jacobian adjustment of the transform. More... | |
| template<typename Mat1 , typename Mat2 , require_all_matrix_t< Mat1, Mat2 > * = nullptr, require_any_var_matrix_t< Mat1, Mat2 > * = nullptr> | |
| auto | columns_dot_product (const Mat1 &v1, const Mat2 &v2) |
| Returns the dot product of columns of the specified matrices. More... | |
| template<typename Mat , require_eigen_vt< is_var, Mat > * = nullptr> | |
| Eigen::Matrix< var, 1, Mat::ColsAtCompileTime > | columns_dot_self (const Mat &x) |
| Returns the dot product of each column of a matrix with itself. More... | |
| template<typename Mat , require_var_matrix_t< Mat > * = nullptr> | |
| auto | columns_dot_self (const Mat &x) |
| Returns the dot product of each column of a matrix with itself. More... | |
| std::complex< var > | conj (const std::complex< var > &z) |
| Return the complex conjugate of the complex argument. More... | |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| var_value< Eigen::MatrixXd > | corr_matrix_constrain (const T &x, Eigen::Index k) |
| Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values. More... | |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| var_value< Eigen::MatrixXd > | corr_matrix_constrain (const T &x, Eigen::Index k, scalar_type_t< T > &lp) |
| Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values. More... | |
| var | cos (var a) |
| Return the cosine of a radian-scaled variable (cmath). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | cos (const VarMat &a) |
| Return the cosine of a radian-scaled variable (cmath). More... | |
| std::complex< var > | cos (const std::complex< var > &z) |
| Return the cosine of the complex argument. More... | |
| var | cosh (const var &a) |
| Return the hyperbolic cosine of the specified variable (cmath). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | cosh (const VarMat &a) |
| Return the hyperbolic cosine of the specified variable (cmath). More... | |
| std::complex< var > | cosh (const std::complex< var > &z) |
| Return the hyperbolic cosine of the complex argument. More... | |
| template<typename T_x , typename = require_arithmetic_t<typename scalar_type<T_x>::type>> | |
| Eigen::Matrix< var,-1,-1 > | cov_exp_quad (const std::vector< T_x > &x, const var &sigma, const var &l) |
| template<typename T_x , typename = require_arithmetic_t<typename scalar_type<T_x>::type>> | |
| Eigen::Matrix< var,-1,-1 > | cov_exp_quad (const std::vector< T_x > &x, double sigma, const var &l) |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| var_value< Eigen::MatrixXd > | cov_matrix_constrain (const T &x, Eigen::Index K) |
| Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2). More... | |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| var_value< Eigen::MatrixXd > | cov_matrix_constrain (const T &x, Eigen::Index K, scalar_type_t< T > &lp) |
| Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2). More... | |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| var_value< Eigen::MatrixXd > | cov_matrix_constrain_lkj (const T &x, size_t k) |
| Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values. More... | |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| var_value< Eigen::MatrixXd > | cov_matrix_constrain_lkj (const T &x, size_t k, scalar_type_t< T > &lp) |
| Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values and increment the specified log probability reference with the log absolute Jacobian determinant. More... | |
| template<typename T1 , typename T2 , require_any_rev_matrix_t< T1, T2 > * = nullptr> | |
| auto | csr_matrix_times_vector (int m, int n, const T1 &w, const std::vector< int > &v, const std::vector< int > &u, const T2 &b) |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| var | determinant (const T &m) |
| var | digamma (const var &a) |
| Return the derivative of the log gamma function at the specified value. More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | digamma (const T &a) |
| Return the elementwise derivative of the log gamma function at the given input vector. More... | |
| template<typename T > | |
| void | dims (const var_value< T > &x, std::vector< int > &result) |
| Pushes dimensions of given argument into given result vector. More... | |
| template<typename T > | |
| void | dims (const vari_value< T > &x, std::vector< int > &result) |
| Pushes dimensions of given argument into given result vector. More... | |
| template<typename T1 , typename T2 , require_all_vector_t< T1, T2 > * = nullptr, require_not_complex_t< return_type_t< T1, T2 >> * = nullptr, require_all_not_std_vector_t< T1, T2 > * = nullptr, require_any_st_var< T1, T2 > * = nullptr> | |
| var | dot_product (const T1 &v1, const T2 &v2) |
| Returns the dot product. More... | |
| template<typename T , require_eigen_vector_vt< is_var, T > * = nullptr> | |
| var | dot_self (const T &v) |
| Returns the dot product of a vector of var with itself. More... | |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| auto | eigenvalues_sym (const T &m) |
| Return the eigenvalues of the specified symmetric matrix. More... | |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| auto | eigenvectors_sym (const T &m) |
| Return the eigenvectors of the specified symmetric matrix. More... | |
| var | erf (const var &a) |
| The error function for variables (C99). More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| auto | erf (const var_value< T > &a) |
| var | erfc (const var &a) |
| The complementary error function for variables (C99). More... | |
| template<typename T , require_matrix_t< T > * = nullptr> | |
| auto | erfc (const var_value< T > &a) |
| var | exp (const var &a) |
| Return the exponentiation of the specified variable (cmath). More... | |
| std::complex< var > | exp (const std::complex< var > &z) |
| Return the exponentiation (base e) of the specified complex number. More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | exp (const T &x) |
| Return the exponentiation of the elements of x. More... | |
| var | exp2 (const var &a) |
| Exponentiation base 2 function for variables (C99). More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| auto | exp2 (const var_value< T > &a) |
| var | expm1 (const var &a) |
| The exponentiation of the specified variable minus 1 (C99). More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| auto | expm1 (const var_value< T > &a) |
| var | fabs (const var &a) |
| Return the absolute value of the variable (cmath). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | fabs (const VarMat &a) |
| Return the absolute value of the variable (cmath). More... | |
| var | falling_factorial (const var &a, int b) |
| template<typename T1 , typename T2 , require_eigen_t< T1 > * = nullptr, require_st_integral< T2 > * = nullptr> | |
| auto | falling_factorial (const var_value< T1 > &a, const T2 &b) |
| var | fdim (const var &a, const var &b) |
| Return the positive difference between the first variable's the value and the second's (C99, C++11). More... | |
| var | fdim (double a, const var &b) |
| Return the positive difference between the first value and the value of the second variable (C99, C++11). More... | |
| var | fdim (const var &a, double b) |
| Return the positive difference between the first variable's value and the second value (C99, C++11). More... | |
| template<typename VarMat , typename S , require_var_matrix_t< VarMat > * = nullptr, require_var_t< S > * = nullptr> | |
| void | fill (VarMat &x, const S &y) |
| Fill the specified container with the specified value. More... | |
| var | floor (const var &a) |
| Return the floor of the specified variable (cmath). More... | |
| template<typename T , require_eigen_t< T > * = nullptr> | |
| auto | floor (const var_value< T > &a) |
| var | fma (const var &x, const var &y, const var &z) |
| The fused multiply-add function for three variables (C99). More... | |
| template<typename Tc , require_arithmetic_t< Tc > * = nullptr> | |
| var | fma (const var &x, const var &y, Tc &&z) |
| The fused multiply-add function for two variables and a value (C99). More... | |
| template<typename Ta , typename Tb , typename Tc , require_arithmetic_t< Tb > * = nullptr, require_all_var_t< Ta, Tc > * = nullptr> | |
| var | fma (Ta &&x, Tb &&y, Tc &&z) |
| The fused multiply-add function for a variable, value, and variable (C99). More... | |
| template<typename Tb , typename Tc , require_all_arithmetic_t< Tb, Tc > * = nullptr> | |
| var | fma (const var &x, Tb &&y, Tc &&z) |
| The fused multiply-add function for a variable and two values (C99). More... | |
| template<typename Ta , typename Tc , require_all_arithmetic_t< Ta, Tc > * = nullptr> | |
| var | fma (Ta &&x, const var &y, Tc &&z) |
| The fused multiply-add function for a value, variable, and value (C99). More... | |
| template<typename Ta , typename Tb , require_all_arithmetic_t< Ta, Tb > * = nullptr> | |
| var | fma (Ta &&x, Tb &&y, const var &z) |
| The fused multiply-add function for two values and a variable, and value (C99). More... | |
| template<typename Ta , require_arithmetic_t< Ta > * = nullptr> | |
| var | fma (Ta &&x, const var &y, const var &z) |
| The fused multiply-add function for a value and two variables (C99). More... | |
| template<typename T1 , typename T2 , typename T3 , require_any_matrix_t< T1, T2, T3 > * = nullptr, require_var_t< return_type_t< T1, T2, T3 >> * = nullptr> | |
| auto | fma (const T1 &x, const T2 &y, const T3 &z) |
| The fused multiply-add function for three variables (C99). More... | |
| var | fmax (const var &a, const var &b) |
| Returns the maximum of the two variable arguments (C99). More... | |
| var | fmax (const var &a, double b) |
| Returns the maximum of the variable and scalar, promoting the scalar to a variable if it is larger (C99). More... | |
| var | fmax (double a, const var &b) |
| Returns the maximum of a scalar and variable, promoting the scalar to a variable if it is larger (C99). More... | |
| var | fmin (const var &a, const var &b) |
| Returns the minimum of the two variable arguments (C99). More... | |
| var | fmin (const var &a, double b) |
| Returns the minimum of the variable and scalar, promoting the scalar to a variable if it is larger (C99). More... | |
| var | fmin (double a, const var &b) |
| Returns the minimum of a scalar and variable, promoting the scalar to a variable if it is larger (C99). More... | |
| var | fmod (const var &a, const var &b) |
| Return the floating point remainder after dividing the first variable by the second (cmath). More... | |
| var | fmod (const var &a, double b) |
| Return the floating point remainder after dividing the the first variable by the second scalar (cmath). More... | |
| var | fmod (double a, const var &b) |
| Return the floating point remainder after dividing the first scalar by the second variable (cmath). More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| Eigen::Matrix< var, T::RowsAtCompileTime, T::ColsAtCompileTime > | from_var_value (const T &a) |
Converts var_value into an Eigen Matrix. More... | |
| template<typename T , require_any_t< conjunction< is_eigen< T >, is_var< scalar_type_t< T >>>, std::is_same< std::decay_t< T >, var >, bool_constant<!std::is_same< scalar_type_t< T >, var >::value >> * = nullptr> | |
| T | from_var_value (T &&a) |
| This is a no-op for Eigen containers of vars, scalars or prim types. More... | |
| template<typename T > | |
| auto | from_var_value (const std::vector< T > &a) |
Convert the elements of the std::vector input to var_value types if possible. More... | |
| var | gamma_p (const var &a, const var &b) |
| var | gamma_p (const var &a, double b) |
| var | gamma_p (double a, const var &b) |
| var | gamma_q (const var &a, const var &b) |
| var | gamma_q (const var &a, double b) |
| var | gamma_q (double a, const var &b) |
| template<typename VarMat , require_rev_matrix_t< VarMat > * = nullptr> | |
| auto | generalized_inverse (const VarMat &G) |
| template<typename T_x , typename T_sigma , require_st_arithmetic< T_x > * = nullptr, require_stan_scalar_t< T_sigma > * = nullptr> | |
| Eigen::Matrix< var,-1,-1 > | gp_exp_quad_cov (const std::vector< T_x > &x, const T_sigma sigma, const var length_scale) |
| Returns a squared exponential kernel. More... | |
| template<typename T_x , typename T_sigma , require_st_arithmetic< T_x > * = nullptr, require_stan_scalar_t< T_sigma > * = nullptr> | |
| Eigen::Matrix< var, Eigen::Dynamic, Eigen::Dynamic > | gp_periodic_cov (const std::vector< T_x > &x, const T_sigma sigma, const var l, const var p) |
| Returns a periodic covariance matrix \( \mathbf{K} \) using the input \( \mathbf{X} \). More... | |
| void | grad (var &v, Eigen::Matrix< var, Eigen::Dynamic, 1 > &x, Eigen::VectorXd &g) |
| Propagate chain rule to calculate gradients starting from the specified variable. More... | |
| void | grad_inc_beta (var &g1, var &g2, const var &a, const var &b, const var &z) |
| Gradient of the incomplete beta function beta(a, b, z) with respect to the first two arguments. More... | |
| var | hypot (const var &a, const var &b) |
| Returns the length of the hypotenuse of a right triangle with sides of the specified lengths (C99). More... | |
| var | hypot (const var &a, double b) |
| Returns the length of the hypotenuse of a right triangle with sides of the specified lengths (C99). More... | |
| var | hypot (double a, const var &b) |
| Returns the length of the hypotenuse of a right triangle with sides of the specified lengths (C99). More... | |
| var | if_else (bool c, const var &y_true, const var &y_false) |
| If the specified condition is true, return the first variable, otherwise return the second variable. More... | |
| var | if_else (bool c, double y_true, const var &y_false) |
| If the specified condition is true, return a new variable constructed from the first scalar, otherwise return the second variable. More... | |
| var | if_else (bool c, const var &y_true, double y_false) |
| If the specified condition is true, return the first variable, otherwise return a new variable constructed from the second scalar. More... | |
| var | inc_beta (const var &a, const var &b, const var &c) |
| template<typename VarMat , typename S , require_var_matrix_t< VarMat > * = nullptr, require_stan_scalar_t< S > * = nullptr> | |
| void | initialize_fill (VarMat &x, const S &y) |
| Fill the specified container with the specified value. More... | |
| void | initialize_variable (var &variable, const var &value) |
| Initialize variable to value. More... | |
| template<int R, int C> | |
| void | initialize_variable (Eigen::Matrix< var, R, C > &matrix, const var &value) |
| Initialize every cell in the matrix to the specified value. More... | |
| template<typename T > | |
| void | initialize_variable (std::vector< T > &variables, const var &value) |
| Initialize the variables in the standard vector recursively. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | inv (const var_value< T > &a) |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | inv_cloglog (const var_value< T > &a) |
| Return the inverse complementary log-log function applied specified variable (stan). More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | inv_logit (const var_value< T > &a) |
| The inverse logit function for variables (stan). More... | |
| var | inv_Phi (const var &p) |
| The inverse of unit normal cumulative density function. More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | inv_Phi (const T &p) |
| Return the elementwise inverse of unit normal cumulative density function. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | inv_sqrt (const var_value< T > &a) |
| var | inv_square (const var &a) |
\[ \mbox{inv\_square}(x) = \begin{cases} \frac{1}{x^2} & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \] More... | |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| auto | inverse (const T &m) |
| Reverse mode specialization of calculating the inverse of the matrix. More... | |
| int | is_inf (const var &v) |
| Returns 1 if the input's value is infinite and 0 otherwise. More... | |
| bool | is_nan (const var &v) |
| Returns 1 if the input's value is NaN and 0 otherwise. More... | |
| bool | is_uninitialized (var x) |
Returns true if the specified variable is uninitialized. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | lambert_w0 (const var_value< T > &a) |
| Return the Lambert W function on W0 branch applied to the specified variable. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | lambert_wm1 (const var_value< T > &a) |
| Return the Lambert W function on W-1 branch applied to the specified variable. More... | |
| template<typename T , typename L , require_all_stan_scalar_t< T, L > * = nullptr, require_any_var_t< T, L > * = nullptr> | |
| auto | lb_constrain (const T &x, const L &lb, var &lp) |
| Return the lower-bounded value for the specified unconstrained input and specified lower bound. More... | |
| template<typename T , typename L , require_matrix_t< T > * = nullptr, require_stan_scalar_t< L > * = nullptr, require_any_st_var< T, L > * = nullptr> | |
| auto | lb_constrain (const T &x, const L &lb) |
Specialization of lb_constrain to apply a scalar lower bound elementwise to each input. More... | |
| var | lbeta (const var &a, const var &b) |
| Returns the natural logarithm of the beta function and its gradients. More... | |
| var | lbeta (const var &a, double b) |
| Returns the natural logarithm of the beta function and its gradients. More... | |
| var | lbeta (double a, const var &b) |
| Returns the natural logarithm of the beta function and its gradients. More... | |
| var | ldexp (const var &a, int b) |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | lgamma (const var_value< T > &a) |
| The log gamma function for variables (C99). More... | |
| var | lmgamma (int a, const var &b) |
| var | lmultiply (const var &a, const var &b) |
| Return the value of a*log(b). More... | |
| var | lmultiply (const var &a, double b) |
| Return the value of a*log(b). More... | |
| var | lmultiply (double a, const var &b) |
| Return the value of a*log(b). More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | log (const var_value< T > &a) |
| Return the natural log of the specified variable (cmath). More... | |
| std::complex< var > | log (const std::complex< var > &z) |
| Return the natural logarithm (base e) of the specified complex argument. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | log10 (const var_value< T > &a) |
| Return the base 10 log of the specified variable (cmath). More... | |
| std::complex< var > | log10 (const std::complex< var > &z) |
| Return the base 10 logarithm of the specified complex number. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | log1m (const var_value< T > &a) |
| The log (1 - x) function for variables. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | log1m_exp (const var_value< T > &x) |
| Return the log of 1 minus the exponential of the specified variable. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | log1m_inv_logit (const var_value< T > &u) |
| Return the natural logarithm of one minus the inverse logit of the specified argument. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | log1p (const var_value< T > &a) |
| The log (1 + x) function for variables (C99). More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | log1p_exp (const var_value< T > &a) |
| Return the log of 1 plus the exponential of the specified variable. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | log2 (const var_value< T > &a) |
| Returns the base 2 logarithm of the specified variable (C99). More... | |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| var | log_determinant (const T &m) |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| var | log_determinant_ldlt (LDLT_factor< T > &A) |
| Returns the log det of the matrix whose LDLT factorization is given. More... | |
| template<typename EigMat , require_eigen_vt< is_var, EigMat > * = nullptr> | |
| var | log_determinant_spd (const EigMat &m) |
| Returns the log det of a symmetric, positive-definite matrix. More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| var | log_determinant_spd (const T &m) |
| Returns the log det of a symmetric, positive-definite matrix. More... | |
| var | log_diff_exp (const var &a, const var &b) |
| Returns the log difference of the exponentiated arguments. More... | |
| var | log_diff_exp (const var &a, double b) |
| Returns the log difference of the exponentiated arguments. More... | |
| var | log_diff_exp (double a, const var &b) |
| Returns the log difference of the exponentiated arguments. More... | |
| var | log_falling_factorial (const var &a, double b) |
| var | log_falling_factorial (const var &a, const var &b) |
| var | log_falling_factorial (double a, const var &b) |
| var | log_inv_logit (const var &u) |
| Return the natural logarithm of the inverse logit of the specified argument. More... | |
| var | log_inv_logit_diff (const var &a, double b) |
| var | log_inv_logit_diff (const var &a, const var &b) |
| var | log_inv_logit_diff (double a, const var &b) |
| void | log_mix_partial_helper (double theta_val, double lambda1_val, double lambda2_val, double &one_m_exp_lam2_m_lam1, double &one_m_t_prod_exp_lam2_m_lam1, double &one_d_t_plus_one_m_t_prod_exp_lam2_m_lam1) |
| template<typename T_theta , typename T_lambda1 , typename T_lambda2 , require_any_var_t< T_theta, T_lambda1, T_lambda2 > * = nullptr> | |
| return_type_t< T_theta, T_lambda1, T_lambda2 > | log_mix (const T_theta &theta, const T_lambda1 &lambda1, const T_lambda2 &lambda2) |
| Return the log mixture density with specified mixing proportion and log densities and its derivative at each. More... | |
| var | log_rising_factorial (const var &a, double b) |
| var | log_rising_factorial (const var &a, const var &b) |
| var | log_rising_factorial (double a, const var &b) |
| var | log_sum_exp (const var &a, const var &b) |
| Returns the log sum of exponentials. More... | |
| var | log_sum_exp (const var &a, double b) |
| Returns the log sum of exponentials. More... | |
| var | log_sum_exp (double a, const var &b) |
| Returns the log sum of exponentials. More... | |
| template<typename T , require_eigen_st< is_var, T > * = nullptr, require_not_var_matrix_t< T > * = nullptr> | |
| var | log_sum_exp (const T &v) |
| Returns the log sum of exponentials of the input. More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| var | log_sum_exp (const T &x) |
| Returns the log sum of exponentials of the input. More... | |
| template<typename T , require_stan_scalar_or_eigen_t< T > * = nullptr> | |
| auto | logit (const var_value< T > &u) |
| Return the log odds of the specified argument. More... | |
| template<typename T , typename L , typename U , require_all_matrix_t< T, L > * = nullptr, require_stan_scalar_t< U > * = nullptr, require_var_t< return_type_t< T, L, U >> * = nullptr> | |
| auto | lub_constrain (const T &x, const L &lb, const U &ub, std::decay_t< return_type_t< T, L, U >> &lp) |
| Specialization for Eigen matrix with matrix lower bound and scalar upper bound plus lp. More... | |
| template<typename Ta , typename Tb , require_all_eigen_t< Ta, Tb > * = nullptr, require_any_st_autodiff< Ta, Tb > * = nullptr> | |
| Eigen::Matrix< return_type_t< Ta, Tb >,-1, Tb::ColsAtCompileTime > | matrix_exp_multiply (const Ta &A, const Tb &B) |
| Wrapper of matrix_exp_action function for a more literal name. More... | |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| plain_type_t< T > | matrix_power (const T &M, const int n) |
| Returns the nth power of the specific matrix. More... | |
| template<typename T1 , typename T2 , require_all_matrix_t< T1, T2 > * = nullptr, require_any_st_var< T1, T2 > * = nullptr> | |
| auto | mdivide_left (const T1 &A, const T2 &B) |
Return the solution X of AX = B. More... | |
| template<typename T1 , typename T2 , require_all_matrix_t< T1, T2 > * = nullptr, require_any_st_var< T1, T2 > * = nullptr> | |
| auto | mdivide_left_ldlt (LDLT_factor< T1 > &A, const T2 &B) |
| Returns the solution of the system Ax=b given an LDLT_factor of A. More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_matrix_base_vt< is_var, EigMat1, EigMat2 > * = nullptr> | |
| Eigen::Matrix< var, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_left_spd (const EigMat1 &A, const EigMat2 &b) |
| template<typename EigMat1 , typename EigMat2 , require_eigen_matrix_base_vt< is_var, EigMat1 > * = nullptr, require_eigen_matrix_base_vt< std::is_arithmetic, EigMat2 > * = nullptr> | |
| Eigen::Matrix< var, EigMat1::RowsAtCompileTime, EigMat2::ColsAtCompileTime > | mdivide_left_spd (const EigMat1 &A, const EigMat2 &b) |
| template<typename T1 , typename T2 , require_all_matrix_t< T1, T2 > * = nullptr, require_any_var_matrix_t< T1, T2 > * = nullptr> | |
| auto | mdivide_left_spd (const T1 &A, const T2 &B) |
| Returns the solution of the system Ax=B where A is symmetric positive definite. More... | |
| template<Eigen::UpLoType TriView, typename T1 , typename T2 , require_all_eigen_vt< is_var, T1, T2 > * = nullptr> | |
| Eigen::Matrix< var, T1::RowsAtCompileTime, T2::ColsAtCompileTime > | mdivide_left_tri (const T1 &A, const T2 &b) |
| template<Eigen::UpLoType TriView, typename T1 , typename T2 , require_eigen_vt< std::is_arithmetic, T1 > * = nullptr, require_eigen_vt< is_var, T2 > * = nullptr> | |
| Eigen::Matrix< var, T1::RowsAtCompileTime, T2::ColsAtCompileTime > | mdivide_left_tri (const T1 &A, const T2 &b) |
| template<Eigen::UpLoType TriView, typename T1 , typename T2 , require_all_matrix_t< T1, T2 > * = nullptr, require_any_var_matrix_t< T1, T2 > * = nullptr> | |
| auto | mdivide_left_tri (const T1 &A, const T2 &B) |
| Returns the solution of the system Ax=B when A is triangular. More... | |
| var | modified_bessel_first_kind (int v, const var &a) |
| var | modified_bessel_second_kind (int v, const var &a) |
| template<typename T1 , typename T2 , require_all_matrix_t< T1, T2 > * = nullptr, require_return_type_t< is_var, T1, T2 > * = nullptr, require_row_and_col_vector_t< T1, T2 > * = nullptr> | |
| var | multiply (const T1 &A, const T2 &B) |
| Return the product of a row vector times a column vector as a scalar. More... | |
| template<typename T1 , typename T2 , require_not_matrix_t< T1 > * = nullptr, require_matrix_t< T2 > * = nullptr, require_return_type_t< is_var, T1, T2 > * = nullptr, require_not_row_and_col_vector_t< T1, T2 > * = nullptr> | |
| auto | multiply (const T1 &A, const T2 &B) |
Return specified matrix multiplied by specified scalar where at least one input has a scalar type of a var_value. More... | |
| var | multiply_log (const var &a, const var &b) |
| Return the value of a*log(b). More... | |
| var | multiply_log (const var &a, double b) |
| Return the value of a*log(b). More... | |
| var | multiply_log (double a, const var &b) |
| Return the value of a*log(b). More... | |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| auto | multiply_lower_tri_self_transpose (const T &L) |
| var | norm (const std::complex< var > &z) |
| Return the squared magnitude of the complex argument. More... | |
| template<typename T , require_rev_col_vector_t< T > * = nullptr> | |
| auto | ordered_constrain (const T &x) |
| Return an increasing ordered vector derived from the specified free vector. More... | |
| template<typename VarVec , require_var_col_vector_t< VarVec > * = nullptr> | |
| auto | ordered_constrain (const VarVec &x, scalar_type_t< VarVec > &lp) |
| Return a positive valued, increasing ordered vector derived from the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More... | |
| var | owens_t (const var &h, const var &a) |
| The Owen's T function of h and a. More... | |
| var | owens_t (const var &h, double a) |
| The Owen's T function of h and a. More... | |
| var | owens_t (double h, const var &a) |
| The Owen's T function of h and a. More... | |
| var | Phi (const var &a) |
| The unit normal cumulative density function for variables (stan). More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | Phi (const T &a) |
| Elementwise unit normal cumulative density function for varmat types. More... | |
| var | Phi_approx (const var &a) |
| Approximation of the unit normal CDF for variables (stan). More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | Phi_approx (const T &a) |
| std::complex< var > | polar (const var &r, const var &theta) |
| Returns complex number with specified magnitude and phase angle. More... | |
| template<typename T > | |
| std::complex< var > | polar (T r, const var &theta) |
| Returns complex number with specified magnitude and phase angle. More... | |
| template<typename T > | |
| std::complex< var > | polar (const var &r, T theta) |
| Returns complex number with specified magnitude and phase angle. More... | |
| template<typename T , require_rev_col_vector_t< T > * = nullptr> | |
| auto | positive_ordered_constrain (const T &x) |
| Return an increasing positive ordered vector derived from the specified free vector. More... | |
| var | pow (const var &base, const var &exponent) |
| Return the base raised to the power of the exponent (cmath). More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| var | pow (const var &base, T exponent) |
| Return the base variable raised to the power of the exponent scalar (cmath). More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| var | pow (T base, const var &exponent) |
| Return the base scalar raised to the power of the exponent variable (cmath). More... | |
| std::complex< var > | pow (const std::complex< var > &x, const std::complex< var > &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| std::complex< var > | pow (const std::complex< var > &x, const std::complex< T > y) |
| Return the first argument raised to the power of the second argument. More... | |
| std::complex< var > | pow (const std::complex< var > &x, const var &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| std::complex< var > | pow (const std::complex< var > &x, T y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| std::complex< var > | pow (std::complex< T > x, const std::complex< var > &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| std::complex< var > | pow (std::complex< T > x, const var &y) |
| Return the first argument raised to the power of the second argument. More... | |
| std::complex< var > | pow (const var &x, const std::complex< var > &y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| std::complex< var > | pow (const var &x, std::complex< T > y) |
| Return the first argument raised to the power of the second argument. More... | |
| template<typename T , typename = require_arithmetic_t<T>> | |
| std::complex< var > | pow (T x, const std::complex< var > &y) |
| Return the first argument raised to the power of the second argument. More... | |
| std::complex< var > | pow (const std::complex< var > &x, int y) |
| Return the first argument raised to the power of the second argument. More... | |
| double | primitive_value (const var &v) |
| Return the primitive double value for the specified autodiff variable. More... | |
| std::complex< var > | proj (const std::complex< var > &z) |
| Return the projection of the complex argument onto the Riemann sphere. More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_not_eigen_col_vector_t< EigMat2 > * = nullptr, require_any_vt_var< EigMat1, EigMat2 > * = nullptr> | |
| promote_scalar_t< var, EigMat2 > | quad_form (const EigMat1 &A, const EigMat2 &B, bool symmetric=false) |
| Return the quadratic form \( B^T A B \). More... | |
| template<typename EigMat , typename ColVec , require_eigen_t< EigMat > * = nullptr, require_eigen_col_vector_t< ColVec > * = nullptr, require_any_vt_var< EigMat, ColVec > * = nullptr> | |
| var | quad_form (const EigMat &A, const ColVec &B, bool symmetric=false) |
| Return the quadratic form \( B^T A B \). More... | |
| template<typename Mat1 , typename Mat2 , require_all_matrix_t< Mat1, Mat2 > * = nullptr, require_not_col_vector_t< Mat2 > * = nullptr, require_any_var_matrix_t< Mat1, Mat2 > * = nullptr> | |
| auto | quad_form (const Mat1 &A, const Mat2 &B, bool symmetric=false) |
| Return the quadratic form \( B^T A B \). More... | |
| template<typename Mat , typename Vec , require_matrix_t< Mat > * = nullptr, require_col_vector_t< Vec > * = nullptr, require_any_var_matrix_t< Mat, Vec > * = nullptr> | |
| var | quad_form (const Mat &A, const Vec &B, bool symmetric=false) |
| Return the quadratic form \( B^T A B \). More... | |
| template<typename EigMat1 , typename EigMat2 , require_all_eigen_t< EigMat1, EigMat2 > * = nullptr, require_any_vt_var< EigMat1, EigMat2 > * = nullptr> | |
| auto | quad_form_sym (const EigMat1 &A, const EigMat2 &B) |
| Return the quadratic form \( B^T A B \) of a symmetric matrix. More... | |
| template<typename T , require_var_vector_t< T > * = nullptr> | |
| auto | read_corr_L (const T &CPCs, size_t K) |
| Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations. More... | |
| template<typename T1 , typename T2 , require_var_vector_t< T1 > * = nullptr, require_stan_scalar_t< T2 > * = nullptr> | |
| auto | read_corr_L (const T1 &CPCs, size_t K, T2 &log_prob) |
| Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation. More... | |
| template<typename T_CPCs , require_var_vector_t< T_CPCs > * = nullptr> | |
| var_value< Eigen::MatrixXd > | read_corr_matrix (const T_CPCs &CPCs, size_t K) |
| Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations. More... | |
| template<typename T_CPCs , require_var_vector_t< T_CPCs > * = nullptr> | |
| var_value< Eigen::MatrixXd > | read_corr_matrix (const T_CPCs &CPCs, size_t K, scalar_type_t< T_CPCs > &log_prob) |
| Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation. More... | |
| template<typename T_CPCs , typename T_sds , require_any_var_vector_t< T_CPCs, T_sds > * = nullptr, require_vt_same< T_CPCs, T_sds > * = nullptr> | |
| auto | read_cov_L (const T_CPCs &CPCs, const T_sds &sds, scalar_type_t< T_CPCs > &log_prob) |
| This is the function that should be called prior to evaluating the density of any elliptical distribution. More... | |
| template<typename T_CPCs , typename T_sds , require_all_var_vector_t< T_CPCs, T_sds > * = nullptr> | |
| var_value< Eigen::MatrixXd > | read_cov_matrix (const T_CPCs &CPCs, const T_sds &sds, scalar_type_t< T_CPCs > &log_prob) |
| A generally worse alternative to call prior to evaluating the density of an elliptical distribution. More... | |
| template<typename T_CPCs , typename T_sds , require_all_var_vector_t< T_CPCs, T_sds > * = nullptr> | |
| var_value< Eigen::MatrixXd > | read_cov_matrix (const T_CPCs &CPCs, const T_sds &sds) |
| Builds a covariance matrix from CPCs and standard deviations. More... | |
| template<typename T_ret , require_var_matrix_t< T_ret > * = nullptr, require_eigen_row_vector_t< value_type_t< T_ret >> * = nullptr> | |
| auto | rep_row_vector (var x, int n) |
Overload for var_value<Vector>. More... | |
| template<typename T_ret , require_var_matrix_t< T_ret > * = nullptr, require_eigen_col_vector_t< value_type_t< T_ret >> * = nullptr> | |
| auto | rep_vector (var x, int n) |
Overload for var_value<Vector>. More... | |
| var | rising_factorial (const var &a, int b) |
| var | round (const var &a) |
| Returns the rounded form of the specified variable (C99). More... | |
| template<typename Mat1 , typename Mat2 , require_all_eigen_t< Mat1, Mat2 > * = nullptr, require_any_eigen_vt< is_var, Mat1, Mat2 > * = nullptr> | |
| Eigen::Matrix< var, Mat1::RowsAtCompileTime, 1 > | rows_dot_product (const Mat1 &v1, const Mat2 &v2) |
| Returns the dot product of rows of the specified matrices. More... | |
| template<typename Mat1 , typename Mat2 , require_all_matrix_t< Mat1, Mat2 > * = nullptr, require_any_var_matrix_t< Mat1, Mat2 > * = nullptr> | |
| auto | rows_dot_product (const Mat1 &v1, const Mat2 &v2) |
| Returns the dot product of rows of the specified matrices. More... | |
| template<typename Mat , require_eigen_vt< is_var, Mat > * = nullptr> | |
| Eigen::Matrix< var, Mat::RowsAtCompileTime, 1 > | rows_dot_self (const Mat &x) |
| Returns the dot product of each row of a matrix with itself. More... | |
| template<typename Mat , require_var_matrix_t< Mat > * = nullptr> | |
| auto | rows_dot_self (const Mat &x) |
| Returns the dot product of row row of a matrix with itself. More... | |
| template<typename T , require_eigen_st< is_var, T > * = nullptr> | |
| var | sd (const T &x) |
| Return the sample standard deviation of a variable which inherits from EigenBase. More... | |
| template<typename T , require_std_vector_st< is_var, T > * = nullptr> | |
| auto | sd (const T &m) |
| Return the sample standard deviation of the specified std vector, column vector, row vector, matrix, or std vector of any of these types. More... | |
| template<typename T , require_rev_col_vector_t< T > * = nullptr> | |
| auto | simplex_constrain (const T &y) |
| Return the simplex corresponding to the specified free vector. More... | |
| template<typename T , require_rev_col_vector_t< T > * = nullptr> | |
| auto | simplex_constrain (const T &y, scalar_type_t< T > &lp) |
| Return the simplex corresponding to the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More... | |
| var | sin (const var &a) |
| Return the sine of a radian-scaled variable (cmath). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | sin (const VarMat &a) |
| Return the sine of a radian-scaled variable (cmath). More... | |
| std::complex< var > | sin (const std::complex< var > &z) |
| Return the sine of the complex argument. More... | |
| template<typename EigMat , require_rev_matrix_t< EigMat > * = nullptr> | |
| auto | singular_values (const EigMat &m) |
| Return the singular values of the specified matrix. More... | |
| var | sinh (const var &a) |
| Return the hyperbolic sine of the specified variable (cmath). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | sinh (const VarMat &a) |
| Return the hyperbolic of a radian-scaled variable (cmath). More... | |
| std::complex< var > | sinh (const std::complex< var > &z) |
| Return the hyperbolic sine of the complex argument. More... | |
| template<typename Mat , require_rev_matrix_t< Mat > * = nullptr> | |
| auto | softmax (const Mat &alpha) |
| Return the softmax of the specified Eigen vector. More... | |
| var | sqrt (const var &a) |
| Return the square root of the specified variable (cmath). More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | sqrt (const T &a) |
| Return elementwise square root of vector. More... | |
| std::complex< var > | sqrt (const std::complex< var > &z) |
| Return the square root of the complex argument. More... | |
| var | square (const var &x) |
| Return the square of the input variable. More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | square (const T &x) |
| Return the elementwise square of x. More... | |
| var | squared_distance (const var &a, const var &b) |
| Returns the squared distance. More... | |
| var | squared_distance (const var &a, double b) |
| Returns the squared distance. More... | |
| var | squared_distance (double a, const var &b) |
| Returns the squared distance. More... | |
| template<typename EigVecVar1 , typename EigVecVar2 , require_all_eigen_vector_vt< is_var, EigVecVar1, EigVecVar2 > * = nullptr> | |
| var | squared_distance (const EigVecVar1 &v1, const EigVecVar2 &v2) |
| template<typename EigVecVar , typename EigVecArith , require_eigen_vector_vt< is_var, EigVecVar > * = nullptr, require_eigen_vector_vt< std::is_arithmetic, EigVecArith > * = nullptr> | |
| var | squared_distance (const EigVecVar &v1, const EigVecArith &v2) |
| template<typename EigVecArith , typename EigVecVar , require_eigen_vector_vt< std::is_arithmetic, EigVecArith > * = nullptr, require_eigen_vector_vt< is_var, EigVecVar > * = nullptr> | |
| var | squared_distance (const EigVecArith &v1, const EigVecVar &v2) |
| template<typename T1 , typename T2 , require_all_vector_t< T1, T2 > * = nullptr, require_any_var_vector_t< T1, T2 > * = nullptr> | |
| var | squared_distance (const T1 &A, const T2 &B) |
| Compute the squared distance between the elements in two inputs. More... | |
| void | stan_print (std::ostream *o, const var &x) |
| var | step (const var &a) |
| Return the step, or heaviside, function applied to the specified variable (stan). More... | |
| template<typename Alloc > | |
| var | sum (const std::vector< var, Alloc > &m) |
| Returns the sum of the entries of the specified vector. More... | |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| var | sum (const T &x) |
| Returns the sum of the coefficients of the specified matrix. More... | |
| template<typename EigMat , require_rev_matrix_t< EigMat > * = nullptr> | |
| auto | svd_U (const EigMat &m) |
Given input matrix m, return matrix U where m = UDV^{T} More... | |
| template<typename EigMat , require_rev_matrix_t< EigMat > * = nullptr> | |
| auto | svd_V (const EigMat &m) |
Given input matrix m, return matrix V where m = UDV^{T} More... | |
| var | tan (const var &a) |
| Return the tangent of a radian-scaled variable (cmath). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | tan (const VarMat &a) |
| Return the tangent of a radian-scaled variable (cmath). More... | |
| std::complex< var > | tan (const std::complex< var > &z) |
| Return the tangent of the complex argument. More... | |
| var | tanh (const var &a) |
| Return the hyperbolic tangent of the specified variable (cmath). More... | |
| template<typename VarMat , require_var_matrix_t< VarMat > * = nullptr> | |
| auto | tanh (const VarMat &a) |
| Return the hyperbolic tangent of elements of a. More... | |
| std::complex< var > | tanh (const std::complex< var > &z) |
| Return the hyperbolic tangent of the complex argument. More... | |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| auto | tcrossprod (const T &M) |
| Returns the result of post-multiplying a matrix by its own transpose. More... | |
| var | tgamma (const var &a) |
| Return the Gamma function applied to the specified variable (C99). More... | |
| template<typename T , require_var_matrix_t< T > * = nullptr> | |
| auto | tgamma (const T &a) |
| Return elementwise gamma function. More... | |
| template<typename T , require_not_same_t< T, arena_t< T >> * = nullptr, require_not_container_t< T > * = nullptr, require_not_matrix_cl_t< T > * = nullptr> | |
| arena_t< T > | to_arena (T &&a) |
| Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered. More... | |
| template<typename T , require_same_t< T, arena_t< T >> * = nullptr, require_not_matrix_cl_t< T > * = nullptr, require_not_std_vector_t< T > * = nullptr> | |
| std::remove_reference_t< T > | to_arena (T &&a) |
| Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered. More... | |
| template<typename T , require_eigen_t< T > * = nullptr, require_not_same_t< T, arena_t< T >> * = nullptr> | |
| arena_t< T > | to_arena (const T &a) |
| Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered. More... | |
| template<typename T > | |
| std::vector< T, arena_allocator< T > > | to_arena (const std::vector< T, arena_allocator< T >> &a) |
| Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered. More... | |
| template<typename T , require_same_t< T, arena_t< T >> * = nullptr> | |
| arena_t< std::vector< T > > | to_arena (const std::vector< T > &a) |
| Converts given argument into a type that has any dynamic allocation on AD stack. More... | |
| template<bool Condition, typename T , std::enable_if_t<!Condition > * = nullptr> | |
| T | to_arena_if (T &&a) |
| If the condition is true, converts given argument into a type that has any dynamic allocation on AD stack. More... | |
| template<bool Condition, typename T , std::enable_if_t< Condition > * = nullptr> | |
| arena_t< T > | to_arena_if (const T &a) |
| var | to_var (double x) |
| Converts argument to an automatic differentiation variable. More... | |
| var & | to_var (var &x) |
| Specialization of to_var for non-const var input. More... | |
| const var & | to_var (const var &x) |
| Specialization of to_var for const var input. More... | |
| std::vector< var > | to_var (const std::vector< double > &v) |
| Converts argument to an automatic differentiation variable. More... | |
| const std::vector< var > & | to_var (const std::vector< var > &v) |
| Specialization of to_var to for const input vector of var. More... | |
| std::vector< var > & | to_var (std::vector< var > &v) |
| Specialization of to_var to for non-const input vector of var. More... | |
| matrix_v | to_var (const matrix_d &m) |
| Converts argument to an automatic differentiation variable. More... | |
| matrix_v & | to_var (matrix_v &m) |
| Specialization of to_var for non-const matrices of vars. More... | |
| const matrix_v & | to_var (const matrix_v &m) |
| Specialization of to_var for const matrices of vars. More... | |
| vector_v | to_var (const vector_d &v) |
| Converts argument to an automatic differentiation variable. More... | |
| const vector_v & | to_var (const vector_v &v) |
| Specialization of to_var for const column vector of vars. More... | |
| vector_v & | to_var (vector_v &v) |
| Specialization of to_var for non-const column vector of vars. More... | |
| row_vector_v | to_var (const row_vector_d &rv) |
| Converts argument to an automatic differentiation variable. More... | |
| const row_vector_v & | to_var (const row_vector_v &rv) |
| Specialization of to_var for const row vector of vars. More... | |
| row_vector_v & | to_var (row_vector_v &rv) |
| Specialization of to_var for non-const row vector of vars. More... | |
| template<typename T , require_eigen_vt< is_var, T > * = nullptr> | |
| var_value< Eigen::Matrix< double, T::RowsAtCompileTime, T::ColsAtCompileTime > > | to_var_value (const T &a) |
Converts an Eigen matrix (or vector or row_vector) or expression of vars into var_value. More... | |
| template<typename T , require_var_t< T > * = nullptr> | |
| T | to_var_value (T &&a) |
| This is a no-op for var_values. More... | |
| template<typename T > | |
| auto | to_var_value (const std::vector< T > &a) |
Convert the elements of the std::vector input to var_value types if possible. More... | |
| template<typename EigMat , require_eigen_t< EigMat > * = nullptr> | |
| auto | to_vector (const var_value< EigMat > &x) |
Reshape a var_value<Matrix> to a var_value<ColumnVector>. More... | |
| template<typename T , require_rev_matrix_t< T > * = nullptr> | |
| auto | trace (const T &m) |
| Returns the trace of the specified matrix. More... | |
| template<typename Td , typename Ta , typename Tb , require_not_col_vector_t< Td > * = nullptr, require_all_matrix_t< Td, Ta, Tb > * = nullptr, require_any_st_var< Td, Ta, Tb > * = nullptr> | |
| var | trace_gen_inv_quad_form_ldlt (const Td &D, LDLT_factor< Ta > &A, const Tb &B) |
| Compute the trace of an inverse quadratic form premultiplied by a square matrix. More... | |
| template<typename Td , typename Ta , typename Tb , require_col_vector_t< Td > * = nullptr, require_all_matrix_t< Ta, Tb > * = nullptr, require_any_st_var< Td, Ta, Tb > * = nullptr> | |
| var | trace_gen_inv_quad_form_ldlt (const Td &D, const LDLT_factor< Ta > &A, const Tb &B) |
| Compute the trace of an inverse quadratic form. More... | |
| template<typename Td , typename Ta , typename Tb , typename = require_any_var_t<value_type_t<Td>, value_type_t<Ta>, value_type_t<Tb>>, typename = require_all_eigen_t<Td, Ta, Tb>> | |
| var | trace_gen_quad_form (const Td &D, const Ta &A, const Tb &B) |
| Return the trace of D times the quadratic form of B and A. More... | |
| template<typename T1 , typename T2 , require_all_matrix_t< T1, T2 > * = nullptr, require_any_st_var< T1, T2 > * = nullptr> | |
| var | trace_inv_quad_form_ldlt (LDLT_factor< T1 > &A, const T2 &B) |
| Compute the trace of an inverse quadratic form premultiplied by a square matrix. More... | |
| template<typename Mat1 , typename Mat2 , require_all_matrix_t< Mat1, Mat2 > * = nullptr, require_any_var_matrix_t< Mat1, Mat2 > * = nullptr> | |
| var | trace_quad_form (const Mat1 &A, const Mat2 &B) |
| Compute trace(B^T A B). More... | |
| var | trigamma (const var &u) |
| Return the value of the trigamma function at the specified argument (i.e., the second derivative of the log Gamma function at the specified argument). More... | |
| var | trunc (const var &a) |
| Returns the truncation of the specified variable (C99). More... | |
| template<typename T , typename U , require_matrix_t< T > * = nullptr, require_stan_scalar_t< U > * = nullptr, require_any_st_var< T, U > * = nullptr> | |
| auto | ub_constrain (const T &x, const U &ub, return_type_t< T, U > &lp) |
Specialization of ub_constrain to apply a scalar upper bound elementwise to each input. More... | |
| template<typename T , require_rev_col_vector_t< T > * = nullptr> | |
| auto | unit_vector_constrain (const T &y) |
| Return the unit length vector corresponding to the free vector y. More... | |
| template<typename T , require_eigen_col_vector_vt< is_var, T > * = nullptr> | |
| auto | unit_vector_constrain (const T &y, var &lp) |
| Return the unit length vector corresponding to the free vector y. More... | |
| template<typename T > | |
| auto & | value_of (const var_value< T > &v) |
| Return the value of the specified variable. More... | |
| template<typename T > | |
| auto | value_of_rec (const var_value< T > &v) |
| Return the value of the specified variable. More... | |
| var | variance (const std::vector< var > &v) |
| Return the sample variance of the specified standard vector. More... | |
| template<typename EigMat , require_eigen_vt< is_var, EigMat > * = nullptr> | |
| var | variance (const EigMat &m) |
| Return the sample variance of the specified vector, row vector, or matrix. More... | |
| template<typename Mat , require_var_matrix_t< Mat > * = nullptr> | |
| var | variance (const Mat &x) |
| Return the sample variance of the var_value matrix Raise domain error if size is not greater than zero. More... | |
| template<typename F , typename T1 , typename T2 , typename T_u , typename T_f > | |
| Eigen::Matrix< T2,-1, 1 > | algebra_solver_fp (const F &f, const Eigen::Matrix< T1,-1, 1 > &x, const Eigen::Matrix< T2,-1, 1 > &y, const std::vector< double > &x_r, const std::vector< int > &x_i, const std::vector< T_u > &u_scale, const std::vector< T_f > &f_scale, std::ostream *msgs=nullptr, double f_tol=1e-8, int max_num_steps=200) |
| Return a fixed pointer to the specified system of algebraic equations of form. More... | |
| template<typename F , typename T , typename... Args, require_eigen_vector_t< T > * = nullptr, require_all_st_arithmetic< Args... > * = nullptr> | |
| Eigen::VectorXd | algebra_solver_newton_impl (const F &f, const T &x, std::ostream *const msgs, const double scaling_step_size, const double function_tolerance, const int64_t max_num_steps, const Args &...args) |
| Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system. More... | |
| template<typename F , typename T , typename... T_Args, require_eigen_vector_t< T > * = nullptr, require_any_st_var< T_Args... > * = nullptr> | |
| Eigen::Matrix< var, Eigen::Dynamic, 1 > | algebra_solver_newton_impl (const F &f, const T &x, std::ostream *const msgs, const double scaling_step_size, const double function_tolerance, const int64_t max_num_steps, const T_Args &...args) |
| Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system. More... | |
| template<typename F , typename T1 , typename T2 , require_all_eigen_vector_t< T1, T2 > * = nullptr> | |
| Eigen::Matrix< scalar_type_t< T2 >, Eigen::Dynamic, 1 > | algebra_solver_newton (const F &f, const T1 &x, const T2 &y, const std::vector< double > &dat, const std::vector< int > &dat_int, std::ostream *const msgs=nullptr, const double scaling_step_size=1e-3, const double function_tolerance=1e-6, const long int max_num_steps=200) |
| Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system. More... | |
| template<typename F , typename T , typename... Args, require_eigen_vector_t< T > * = nullptr> | |
| T & | algebra_solver_powell_call_solver (const F &f, T &x, std::ostream *const msgs, const double relative_tolerance, const double function_tolerance, const int64_t max_num_steps, const Args &...args) |
| Solve algebraic equations using Powell solver. More... | |
| template<typename F , typename T , typename... Args, require_eigen_vector_t< T > * = nullptr, require_all_st_arithmetic< Args... > * = nullptr> | |
| Eigen::VectorXd | algebra_solver_powell_impl (const F &f, const T &x, std::ostream *const msgs, const double relative_tolerance, const double function_tolerance, const int64_t max_num_steps, const Args &...args) |
| Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system. More... | |
| template<typename F , typename T1 , typename T2 , require_all_eigen_vector_t< T1, T2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< T2 >, Eigen::Dynamic, 1 > | algebra_solver_powell (const F &f, const T1 &x, const T2 &y, const std::vector< double > &dat, const std::vector< int > &dat_int, std::ostream *const msgs=nullptr, const double relative_tolerance=1e-10, const double function_tolerance=1e-6, const int64_t max_num_steps=1e+3) |
| Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system. More... | |
| template<typename F , typename T1 , typename T2 , require_all_eigen_vector_t< T1, T2 > * = nullptr> | |
| Eigen::Matrix< value_type_t< T2 >, Eigen::Dynamic, 1 > | algebra_solver (const F &f, const T1 &x, const T2 &y, const std::vector< double > &dat, const std::vector< int > &dat_int, std::ostream *msgs=nullptr, const double relative_tolerance=1e-10, const double function_tolerance=1e-6, const int64_t max_num_steps=1e+3) |
| Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system. More... | |
| template<typename F , typename T , typename... T_Args, require_eigen_vector_t< T > * = nullptr, require_any_st_var< T_Args... > * = nullptr> | |
| Eigen::Matrix< var, Eigen::Dynamic, 1 > | algebra_solver_powell_impl (const F &f, const T &x, std::ostream *const msgs, const double relative_tolerance, const double function_tolerance, const int64_t max_num_steps, const T_Args &...args) |
| Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system. More... | |
| template<typename T1 , typename T2 > | |
| void | algebra_solver_check (const Eigen::Matrix< T1, Eigen::Dynamic, 1 > &x, const Eigen::Matrix< T2, Eigen::Dynamic, 1 > y, const std::vector< double > &dat, const std::vector< int > &dat_int, double function_tolerance, long int max_num_steps) |
| void | cvodes_err_handler (int error_code, const char *module, const char *function, char *msg, void *eh_data) |
| void | cvodes_set_options (void *cvodes_mem, long int max_num_steps) |
| template<typename F > | |
| void | gradient (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, double &fx, Eigen::Matrix< double, Eigen::Dynamic, 1 > &grad_fx) |
| Calculate the value and the gradient of the specified function at the specified argument. More... | |
| template<typename F , typename T_a , typename T_b , typename... Args, require_any_st_var< T_a, T_b, Args... > * = nullptr> | |
| return_type_t< T_a, T_b, Args... > | integrate_1d_impl (const F &f, const T_a &a, const T_b &b, double relative_tolerance, std::ostream *msgs, const Args &...args) |
| Return the integral of f from a to b to the given relative tolerance. More... | |
| template<typename F , typename T_a , typename T_b , typename T_theta , typename = require_any_var_t<T_a, T_b, T_theta>> | |
| return_type_t< T_a, T_b, T_theta > | integrate_1d (const F &f, const T_a &a, const T_b &b, const std::vector< T_theta > &theta, const std::vector< double > &x_r, const std::vector< int > &x_i, std::ostream *msgs, const double relative_tolerance=std::sqrt(EPSILON)) |
| Compute the integral of the single variable function f from a to b to within a specified relative tolerance. More... | |
| template<typename F , typename Tpar > | |
| std::vector< std::vector< Tpar > > | integrate_dae (const F &f, const std::vector< double > &yy0, const std::vector< double > &yp0, double t0, const std::vector< double > &ts, const std::vector< Tpar > &theta, const std::vector< double > &x_r, const std::vector< int > &x_i, const double rtol, const double atol, const int64_t max_num_steps=idas_integrator::IDAS_MAX_STEPS, std::ostream *msgs=nullptr) |
| Return the solutions for a semi-explicit DAE system with residual specified by functor F, given the specified consistent initial state yy0 and yp0. More... | |
| template<typename F , typename T_y0 , typename T_param , typename T_t0 , typename T_ts > | |
| std::vector< std::vector< return_type_t< T_y0, T_param, T_t0, T_ts > > > | integrate_ode_adams (const F &f, const std::vector< T_y0 > &y0, const T_t0 &t0, const std::vector< T_ts > &ts, const std::vector< T_param > &theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs=nullptr, double relative_tolerance=1e-10, double absolute_tolerance=1e-10, long int max_num_steps=1e8) |
| template<typename F , typename T_y0 , typename T_param , typename T_t0 , typename T_ts > | |
| std::vector< std::vector< return_type_t< T_y0, T_param, T_t0, T_ts > > > | integrate_ode_bdf (const F &f, const std::vector< T_y0 > &y0, const T_t0 &t0, const std::vector< T_ts > &ts, const std::vector< T_param > &theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs=nullptr, double relative_tolerance=1e-10, double absolute_tolerance=1e-10, long int max_num_steps=1e8) |
| template<typename F > | |
| void | jacobian (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, Eigen::Matrix< double, Eigen::Dynamic, 1 > &fx, Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &J) |
| template<typename F1 , typename... Args> | |
| Eigen::VectorXd | kinsol_solve (const F1 &f, const Eigen::VectorXd &x, const double scaling_step_tol, const double function_tolerance, const int64_t max_num_steps, const bool custom_jacobian, const int steps_eval_jacobian, const int global_line_search, std::ostream *const msgs, const Args &...args) |
| Return the solution to the specified algebraic system, given an initial guess. More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... T_Args, require_eigen_col_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > | ode_adams_tol_impl (const char *function_name, const F &f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const T_Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... T_Args, require_eigen_col_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > | ode_adams_tol (const F &f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const T_Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... T_Args, require_eigen_col_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > | ode_adams (const F &f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, std::ostream *msgs, const T_Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename T_abs_tol_fwd , typename T_abs_tol_bwd , typename... T_Args, require_all_eigen_col_vector_t< T_y0, T_abs_tol_fwd, T_abs_tol_bwd > * = nullptr, require_any_not_st_arithmetic< T_y0, T_t0, T_ts, T_Args... > * = nullptr> | |
| auto | ode_adjoint_impl (const char *function_name, F &&f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, double relative_tolerance_forward, const T_abs_tol_fwd &absolute_tolerance_forward, double relative_tolerance_backward, const T_abs_tol_bwd &absolute_tolerance_backward, double relative_tolerance_quadrature, double absolute_tolerance_quadrature, long int max_num_steps, long int num_steps_between_checkpoints, int interpolation_polynomial, int solver_forward, int solver_backward, std::ostream *msgs, const T_Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename T_abs_tol_fwd , typename T_abs_tol_bwd , typename... T_Args, require_all_eigen_col_vector_t< T_y0, T_abs_tol_fwd, T_abs_tol_bwd > * = nullptr, require_all_st_arithmetic< T_y0, T_t0, T_ts, T_Args... > * = nullptr> | |
| std::vector< Eigen::VectorXd > | ode_adjoint_impl (const char *function_name, F &&f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, double relative_tolerance_forward, const T_abs_tol_fwd &absolute_tolerance_forward, double relative_tolerance_backward, const T_abs_tol_bwd &absolute_tolerance_backward, double relative_tolerance_quadrature, double absolute_tolerance_quadrature, long int max_num_steps, long int num_steps_between_checkpoints, int interpolation_polynomial, int solver_forward, int solver_backward, std::ostream *msgs, const T_Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename T_abs_tol_fwd , typename T_abs_tol_bwd , typename... T_Args, require_all_eigen_col_vector_t< T_y0, T_abs_tol_fwd, T_abs_tol_bwd > * = nullptr> | |
| auto | ode_adjoint_tol_ctl (F &&f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, double relative_tolerance_forward, const T_abs_tol_fwd &absolute_tolerance_forward, double relative_tolerance_backward, const T_abs_tol_bwd &absolute_tolerance_backward, double relative_tolerance_quadrature, double absolute_tolerance_quadrature, long int max_num_steps, long int num_steps_between_checkpoints, int interpolation_polynomial, int solver_forward, int solver_backward, std::ostream *msgs, const T_Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... T_Args, require_eigen_col_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > | ode_bdf_tol_impl (const char *function_name, const F &f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const T_Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... T_Args, require_eigen_col_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > | ode_bdf_tol (const F &f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, double relative_tolerance, double absolute_tolerance, long int max_num_steps, std::ostream *msgs, const T_Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0 , typename T_t0 , typename T_ts , typename... T_Args, require_eigen_col_vector_t< T_y0 > * = nullptr> | |
| std::vector< Eigen::Matrix< stan::return_type_t< T_y0, T_t0, T_ts, T_Args... >, Eigen::Dynamic, 1 > > | ode_bdf (const F &f, const T_y0 &y0, const T_t0 &t0, const std::vector< T_ts > &ts, std::ostream *msgs, const T_Args &...args) |
| Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ... More... | |
| template<typename F , typename T_y0_t0 , typename T_t0 , typename T_t , typename... Args, require_any_autodiff_t< T_y0_t0, T_t0, T_t, scalar_type_t< Args >... > * = nullptr> | |
| Eigen::Matrix< var, Eigen::Dynamic, 1 > | ode_store_sensitivities (const F &f, const std::vector< double > &coupled_state, const Eigen::Matrix< T_y0_t0, Eigen::Dynamic, 1 > &y0, const T_t0 &t0, const T_t &t, std::ostream *msgs, const Args &...args) |
| Build output vars for a state of the ODE solve, storing the sensitivities precomputed using the forward sensitivity problem in precomputed varis. More... | |
| template<typename T , typename L , typename U , require_not_std_vector_t< T > * = nullptr, require_all_stan_scalar_t< L, U > * = nullptr> | |
| auto | lub_free (T &&y, L &&lb, U &&ub) |
| lub_free Return the unconstrained variable that transforms to the y given the specified bounds. More... | |
| template<typename T , typename L , typename U , require_all_eigen_t< T, L, U > * = nullptr> | |
| auto | lub_free (T &&y, L &&lb, U &&ub) |
| Overload for matrix constrained variable, matrix upper bound, matrix lower bound. More... | |
| template<typename T , typename L , typename U , require_all_not_std_vector_t< L, U > * = nullptr> | |
| auto | lub_free (const std::vector< T > y, const L &lb, const U &ub) |
Overload for std::vector constrained variable. More... | |
| template<typename T , typename L , typename U , require_not_std_vector_t< L > * = nullptr> | |
| auto | lub_free (const std::vector< T > y, const L &lb, const std::vector< U > &ub) |
Overload for std::vector constrained variable and std::vector upper bound. More... | |
| template<typename T , typename L , typename U , require_not_std_vector_t< U > * = nullptr> | |
| auto | lub_free (const std::vector< T > y, const std::vector< L > &lb, const U &ub) |
Overload for std::vector constrained variable and std::vector lower bound. More... | |
| template<typename T , typename L , typename U > | |
| auto | lub_free (const std::vector< T > y, const std::vector< L > &lb, const std::vector< U > &ub) |
Overload for std::vector constrained variable and std::vector constraints. More... | |
Variables | |
| static opencl_context | opencl_context |
| const double | CONSTRAINT_TOLERANCE = 1E-8 |
| The tolerance for checking arithmetic bounds in rank and in simplexes. More... | |
| static constexpr double | EPSILON = std::numeric_limits<double>::epsilon() |
| Smallest positive value. More... | |
| static constexpr double | INFTY = std::numeric_limits<double>::infinity() |
| Positive infinity. More... | |
| static constexpr double | NEGATIVE_INFTY = -INFTY |
| Negative infinity. More... | |
| static constexpr double | NOT_A_NUMBER = std::numeric_limits<double>::quiet_NaN() |
| (Quiet) not-a-number value. More... | |
| static constexpr double | TWO_PI = boost::math::constants::two_pi<double>() |
| Twice the value of \( \pi \), \( 2\pi \). More... | |
| static constexpr double | LOG_ZERO = -INFTY |
| The natural logarithm of 0, \( \log 0 \). More... | |
| const double | LOG_EPSILON = std::log(EPSILON) |
| The natural logarithm of machine precision \( \epsilon \), \( \log \epsilon \). More... | |
| const double | LOG_PI = std::log(pi()) |
| The natural logarithm of \( \pi \), \( \log \pi \). More... | |
| static constexpr double | LOG_TWO = boost::math::constants::ln_two<double>() |
| The natural logarithm of 2, \( \log 2 \). More... | |
| static constexpr double | LOG_HALF = -LOG_TWO |
| The natural logarithm of 0.5, \( \log 0.5 = \log 1 - \log 2 \). More... | |
| const double | LOG_TWO_PI = LOG_TWO + LOG_PI |
| The natural logarithm of 2 plus the natural logarithm of \( \pi \), \( \log(2\pi) \). More... | |
| const double | LOG_PI_OVER_FOUR = 0.25 * LOG_PI |
| The value of one quarter the natural logarithm of \( \pi \), \( \log(\pi) / 4 \). More... | |
| const double | LOG_SQRT_PI = std::log(boost::math::constants::root_pi<double>()) |
| The natural logarithm of the square root of \( \pi \), \( \log(sqrt{\pi}) \). More... | |
| static constexpr double | LOG_TEN = boost::math::constants::ln_ten<double>() |
| The natural logarithm of 10, \( \log 10 \). More... | |
| static constexpr double | SQRT_TWO = boost::math::constants::root_two<double>() |
| The value of the square root of 2, \( \sqrt{2} \). More... | |
| static constexpr double | SQRT_PI = boost::math::constants::root_pi<double>() |
| The value of the square root of \( \pi \), \( \sqrt{\pi} \). More... | |
| static constexpr double | SQRT_TWO_PI = boost::math::constants::root_two_pi<double>() |
| The value of the square root of \( 2\pi \), \( \sqrt{2\pi} \). More... | |
| static constexpr double | SQRT_TWO_OVER_SQRT_PI = SQRT_TWO / SQRT_PI |
| The square root of 2 divided by the square root of \( \pi \), \( \sqrt{2} / \sqrt{\pi} \). More... | |
| static constexpr double | INV_SQRT_TWO = boost::math::constants::one_div_root_two<double>() |
| The value of 1 over the square root of 2, \( 1 / \sqrt{2} \). More... | |
| static constexpr double | INV_SQRT_PI = boost::math::constants::one_div_root_pi<double>() |
| The value of 1 over the square root of \( \pi \), \( 1 / \sqrt{\pi} \). More... | |
| static constexpr double | INV_SQRT_TWO_PI = boost::math::constants::one_div_root_two_pi<double>() |
| The value of 1 over the square root of \( 2\pi \), \( 1 / \sqrt{2\pi} \). More... | |
| static constexpr double | TWO_OVER_SQRT_PI = boost::math::constants::two_div_root_pi<double>() |
| The value of 2 over the square root of \( \pi \), \( 2 / \sqrt{\pi} \). More... | |
| static constexpr double | HALF_LOG_TWO = 0.5 * LOG_TWO |
| The value of half the natural logarithm 2, \( \log(2) / 2 \). More... | |
| const double | HALF_LOG_TWO_PI = 0.5 * LOG_TWO_PI |
| The value of half the natural logarithm \( 2\pi \), \( \log(2\pi) / 2 \). More... | |
| const double | NEG_LOG_SQRT_TWO_PI = -std::log(SQRT_TWO_PI) |
| The value of minus the natural logarithm of the square root of \( 2\pi \), \( -\log(\sqrt{2\pi}) \). More... | |
| const double | POISSON_MAX_RATE = std::pow(2.0, 30) |
| Largest rate parameter allowed in Poisson RNG. More... | |
| constexpr double | lgamma_stirling_diff_useful = 10 |
| const std::string | MAJOR_VERSION = "4" |
| Major version number for Stan math library. More... | |
| const std::string | MINOR_VERSION = "2" |
| Minor version number for Stan math library. More... | |
| const std::string | PATCH_VERSION = "1" |
| Patch version for Stan math library. More... | |
| struct stan::math::apply_scalar_unary |
| struct stan::math::apply_vector_unary |
| struct stan::math::coupled_ode_system_impl |
| struct stan::math::FixedPointSolver |
| class stan::math::LDLT_factor |
| struct stan::math::promote_scalar_type< T, S, require_all_t< is_var< T >, is_var< S >, is_eigen< value_type_t< S > > > > |
| struct stan::math::promote_scalar_type< T, S, require_all_t< std::is_arithmetic< T >, is_var< S >, is_eigen< value_type_t< S > > > > |
| Class Members | ||
|---|---|---|
|
typedef typename promote_scalar_type< T, value_type_t< S >>::type |
type | The promoted type. |
| struct stan::math::promote_scalar_type< T, S, require_eigen_t< S > > |
| Class Members | ||
|---|---|---|
|
typedef typename conditional < is_same< typename traits < decay_t< S >>::XprKind, MatrixXpr >::value, Matrix < typename promote_scalar_type < T, typename Scalar >::type, RowsAtCompileTime, ColsAtCompileTime >, Array < typename promote_scalar_type < T, typename Scalar >::type, RowsAtCompileTime, ColsAtCompileTime >>::type |
type | The promoted type. |
| struct stan::math::promote_scalar_type< T, std::vector< S > > |
| Class Members | ||
|---|---|---|
|
typedef vector< typename promote_scalar_type< T, S > ::type > |
type | The promoted type. |
| struct stan::math::ref_type_for_opencl |
| Class Members | ||
|---|---|---|
|
typedef conditional_t < is_rvalue_reference< T > ::value, T_val, const T & > |
T_optionally_ref | |
|
typedef pinned_matrix < T_plain_col_major > |
T_pinned | |
|
typedef conditional_t< is_same < typename traits< T_val > ::XprKind, MatrixXpr >::value, Matrix< value_type_t< T > , RowsAtCompileTime, ColsAtCompileTime >, Array < value_type_t< T > , RowsAtCompileTime, ColsAtCompileTime >> |
T_plain_col_major | |
| typedef remove_reference_t< T > | T_val | |
|
typedef decay_t< decltype(declval < T_val >() |
T_val_derived | |
|
typedef conditional_t< traits < Ref< decay_t < T_plain_col_major > >>::template match < T_val_derived > ::MatchAtCompileTime &&(evaluator< T_val_derived > ::Flags &LinearAccessBit)&&(evaluator < T_val_derived >::Flags &PacketAccessBit), T_optionally_ref, T_pinned > |
type | |
| struct stan::math::ref_type_for_opencl< T, require_arena_matrix_t< T > > |
| Class Members | ||
|---|---|---|
|
typedef typename ref_type_for_opencl< typename decay_t< T >::Base >::type |
type | |
| struct stan::math::ref_type_for_opencl< T, require_not_eigen_t< T > > |
| class stan::math::var_value |
| class stan::math::vari_view |
| using stan::math::boost_policy_t = typedef boost::math::policies::policy< boost::math::policies::overflow_error< boost::math::policies::errno_on_error>, boost::math::policies::pole_error<boost::math::policies::errno_on_error>, boost::math::policies::promote_double<false>, boost::math::policies::digits2<B>> |
Boost policy that overrides the defaults to match the built-in C++ standard library functions.
The non-default behavior from Boost's built-ins are (1) overflow errors return error numbers on error. (2) pole errors return error numbers on error. (3) doubles passed to Boost are not promoted to long double.
The policy is equipped with an optional generic argument B controlling the precision in some functions. If set to 0, the maximum precision available in the type being used is demanded from Boost. Otherwise, it correspond to the approximately B-bit precision, i.e. for trading speed for accuracy.
Definition at line 30 of file boost_policy.hpp.
| using stan::math::ChainableStack = typedef AutodiffStackSingleton<vari_base, chainable_alloc> |
Definition at line 9 of file chainablestack.hpp.
| using stan::math::common_scalar_t = typedef typename std::common_type_t< typename std::remove_reference_t<Types>::Scalar...> |
Wrapper for std::common_type_t
Definition at line 13 of file common_return_scalar.hpp.
| typedef stan::math::index_type_t< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >> stan::math::size_type |
Type for sizes and indexes in an Eigen matrix with double elements.
Definition at line 38 of file index_type.hpp.
| using stan::math::matrix_d = typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> |
Type for matrix of double values.
Definition at line 19 of file typedefs.hpp.
| using stan::math::matrix_fd = typedef Eigen::Matrix<fvar<double>, Eigen::Dynamic, Eigen::Dynamic> |
Definition at line 13 of file typedefs.hpp.
| using stan::math::matrix_ffd = typedef Eigen::Matrix<fvar<fvar<double> >, Eigen::Dynamic, Eigen::Dynamic> |
Definition at line 16 of file typedefs.hpp.
| using stan::math::matrix_ffv = typedef Eigen::Matrix<fvar<fvar<var>>, Eigen::Dynamic, Eigen::Dynamic> |
Definition at line 15 of file typedefs.hpp.
| using stan::math::matrix_fv = typedef Eigen::Matrix<fvar<var>, Eigen::Dynamic, Eigen::Dynamic> |
Definition at line 12 of file typedefs.hpp.
| using stan::math::matrix_v = typedef Eigen::Matrix<var, Eigen::Dynamic, Eigen::Dynamic> |
The type of a matrix holding var values.
Definition at line 18 of file typedefs.hpp.
| using stan::math::matrix_vi = typedef Eigen::Matrix<vari*, Eigen::Dynamic, Eigen::Dynamic> |
The type of a matrix holding vari* values.
Definition at line 36 of file typedefs.hpp.
| using stan::math::precomputed_gradients_vari = typedef precomputed_gradients_vari_template<std::tuple<>, std::tuple<>> |
Definition at line 189 of file precomputed_gradients.hpp.
| using stan::math::profile_key = typedef std::pair<std::string, std::thread::id> |
Definition at line 116 of file profiling.hpp.
| using stan::math::profile_map = typedef std::map<profile_key, profile_info> |
Definition at line 118 of file profiling.hpp.
| using stan::math::promote_scalar_t = typedef typename promote_scalar_type<std::decay_t<T>, std::decay_t<S>>::type |
Definition at line 98 of file promote_scalar_type.hpp.
| using stan::math::ref_type_for_opencl_t = typedef typename ref_type_for_opencl<T>::type |
Definition at line 64 of file ref_type_for_opencl.hpp.
| using stan::math::row_vector_d = typedef Eigen::Matrix<double, 1, Eigen::Dynamic> |
Type for (row) vector of double values.
Definition at line 29 of file typedefs.hpp.
| using stan::math::row_vector_fd = typedef Eigen::Matrix<fvar<double>, 1, Eigen::Dynamic> |
Definition at line 22 of file typedefs.hpp.
| using stan::math::row_vector_ffd = typedef Eigen::Matrix<fvar<fvar<double> >, 1, Eigen::Dynamic> |
Definition at line 24 of file typedefs.hpp.
| using stan::math::row_vector_ffv = typedef Eigen::Matrix<fvar<fvar<var>>, 1, Eigen::Dynamic> |
Definition at line 23 of file typedefs.hpp.
| using stan::math::row_vector_fv = typedef Eigen::Matrix<fvar<var>, 1, Eigen::Dynamic> |
Definition at line 21 of file typedefs.hpp.
| using stan::math::row_vector_v = typedef Eigen::Matrix<var, 1, Eigen::Dynamic> |
The type of a row vector holding var values.
Definition at line 30 of file typedefs.hpp.
| using stan::math::row_vector_vi = typedef Eigen::Matrix<vari*, 1, Eigen::Dynamic> |
The type of a row vector holding vari* values.
Definition at line 48 of file typedefs.hpp.
| typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index stan::math::size_type |
Type for sizes and indexes in an Eigen matrix with double elements.
Definition at line 11 of file typedefs.hpp.
| using stan::math::var = typedef var_value<double> |
| using stan::math::vari = typedef vari_value<double> |
| using stan::math::vector_d = typedef Eigen::Matrix<double, Eigen::Dynamic, 1> |
Type for (column) vector of double values.
Definition at line 24 of file typedefs.hpp.
| using stan::math::vector_fd = typedef Eigen::Matrix<fvar<double>, Eigen::Dynamic, 1> |
Definition at line 18 of file typedefs.hpp.
| using stan::math::vector_ffd = typedef Eigen::Matrix<fvar<fvar<double> >, Eigen::Dynamic, 1> |
Definition at line 20 of file typedefs.hpp.
| using stan::math::vector_ffv = typedef Eigen::Matrix<fvar<fvar<var>>, Eigen::Dynamic, 1> |
Definition at line 19 of file typedefs.hpp.
| using stan::math::vector_fv = typedef Eigen::Matrix<fvar<var>, Eigen::Dynamic, 1> |
Definition at line 17 of file typedefs.hpp.
| using stan::math::vector_v = typedef Eigen::Matrix<var, Eigen::Dynamic, 1> |
The type of a (column) vector holding var values.
Definition at line 24 of file typedefs.hpp.
| using stan::math::vector_vi = typedef Eigen::Matrix<vari*, Eigen::Dynamic, 1> |
The type of a (column) vector holding vari* values.
Definition at line 42 of file typedefs.hpp.
|
strong |
| Enumerator | |
|---|---|
| Diagonal | |
| Lower | |
| Upper | |
| Entire | |
Definition at line 11 of file matrix_cl_view.hpp.
| T stan::math::abs | ( | T | x | ) |
| std::vector<T> stan::math::abs | ( | const std::vector< T > & | x | ) |
|
inline |
Return the absolute value of the variable (std).
Delegates to fabs() (see for doc).
\[ \mbox{abs}(x) = \begin{cases} |x| & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{abs}(x)}{\partial x} = \begin{cases} -1 & \mbox{if } x < 0 \\ 0 & \mbox{if } x = 0 \\ 1 & \mbox{if } x > 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| T | A floating point type or an Eigen type with floating point scalar. |
| a | Variable input. |
| Eigen::Matrix<T, R, C> stan::math::abs | ( | const Eigen::Matrix< T, R, C > & | x | ) |
Return the elementwise absolute value of the specified matrix, vector, or row vector.
| T | type of scalar for matrix argument (real or complex) |
| R | row specification (1 or -1) |
| C | column specification (1 or -1) |
| x | argument |
| auto stan::math::abs | ( | T | x | ) |
|
inline |
Accumulate adjoints from x into storage pointed to by dest, increment the adjoint storage pointer, recursively accumulate the adjoints of the rest of the arguments, and return final position of storage pointer.
| Pargs | Types of remaining arguments |
| dest | Pointer to where adjoints are to be accumulated |
| x | A var |
| args | Further args to accumulate over |
Definition at line 51 of file accumulate_adjoints.hpp.
|
inline |
Accumulate adjoints from std::vector x into storage pointed to by dest, increment the adjoint storage pointer, recursively accumulate the adjoints of the rest of the arguments, and return final position of storage pointer.
| Pargs | Types of remaining arguments |
| dest | Pointer to where adjoints are to be accumulated |
| x | A std::vector of vars |
| args | Further args to accumulate over |
Definition at line 71 of file accumulate_adjoints.hpp.
|
inline |
Accumulate adjoints from x (a std::vector of containers containing vars) into storage pointed to by dest, increment the adjoint storage pointer, recursively accumulate the adjoints of the rest of the arguments, and return final position of storage pointer.
| VecContainer | the type of a standard container holding var containers. |
| Pargs | Types of remaining arguments |
| dest | Pointer to where adjoints are to be accumulated |
| x | A std::vector of containers holding vars |
| args | Further args to accumulate over |
Definition at line 96 of file accumulate_adjoints.hpp.
|
inline |
Accumulate adjoints from x (an Eigen type containing vars) into storage pointed to by dest, increment the adjoint storage pointer, recursively accumulate the adjoints of the rest of the arguments, and return final position of storage pointer.
| EigT | Type derived from EigenBase containing vars. |
| Pargs | Types of remaining arguments |
| dest | Pointer to where adjoints are to be accumulated |
| x | An eigen type holding vars to accumulate over |
| args | Further args to accumulate over |
Definition at line 119 of file accumulate_adjoints.hpp.
|
inline |
Ignore arithmetic types.
Recursively accumulate the adjoints of the rest of the arguments and return final position of adjoint storage pointer.
| Arith | A type satisfying std::is_arithmetic. |
| Pargs | Types of remaining arguments |
| dest | Pointer to where adjoints are to be accumulated |
| x | An object that is either arithmetic or a container of Arithmetic types |
| args | Further args to accumulate over |
Definition at line 139 of file accumulate_adjoints.hpp.
|
inline |
End accumulate_adjoints recursion and return pointer.
| dest | Pointer |
Definition at line 148 of file accumulate_adjoints.hpp.
|
inline |
Return the principal value of the arc cosine of a variable, in radians (cmath).
The derivative is defined by
\(\frac{d}{dx} \arccos x = \frac{-1}{\sqrt{1 - x^2}}\).
\[ \mbox{acos}(x) = \begin{cases} \textrm{NaN} & \mbox{if } x < -1\\ \arccos(x) & \mbox{if } -1\leq x\leq 1 \\ \textrm{NaN} & \mbox{if } x > 1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{acos}(x)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < -1\\ \frac{\partial\, \arccos(x)}{\partial x} & \mbox{if } -1\leq x\leq 1 \\ \textrm{NaN} & \mbox{if } x < -1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial \, \arccos(x)}{\partial x} = -\frac{1}{\sqrt{1-x^2}} \]
| x | argument |
|
inline |
|
inline |
|
inline |
|
inline |
The inverse hyperbolic cosine function for variables (C99).
For non-variable function, see acosh().
The derivative is defined by
\(\frac{d}{dx} \mbox{acosh}(x) = \frac{x}{x^2 - 1}\).
\[ \mbox{acosh}(x) = \begin{cases} \textrm{NaN} & \mbox{if } x < 1 \\ \cosh^{-1}(x) & \mbox{if } x \geq 1 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{acosh}(x)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < 1 \\ \frac{\partial\, \cosh^{-1}(x)}{\partial x} & \mbox{if } x \geq 1 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \cosh^{-1}(x)=\ln\left(x+\sqrt{x^2-1}\right) \]
\[ \frac{\partial \, \cosh^{-1}(x)}{\partial x} = \frac{1}{\sqrt{x^2-1}} \]
| x | The variable. |
|
inline |
|
inline |
Return the elementwise application of acosh() to specified argument container.
The return type promotes the underlying scalar argument type to double if it is an integer, and otherwise is the argument type.
| T | type of container |
| x | container |
|
inline |
|
inline |
|
inline |
Return the sum of the specified matrices.
The two matrices must have the same dimensions.
| Mat1 | type of the first matrix or expression |
| Mat2 | type of the second matrix or expression |
| m1 | First matrix or expression. |
| m2 | Second matrix or expression. |
| std::invalid_argument | if m1 and m2 do not have the same dimensions. |
|
inline |
|
inline |
|
inline |
Addition operator for matrix variables (C++).
| VarMat1 | A matrix of vars or a var with an underlying matrix type. |
| VarMat2 | A matrix of vars or a var with an underlying matrix type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 111 of file operator_addition.hpp.
|
inline |
Addition operator for a matrix variable and arithmetic (C++).
| VarMat | A matrix of vars or a var with an underlying matrix type. |
| Arith | A type with an arithmetic Scalar type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 142 of file operator_addition.hpp.
|
inline |
Addition operator for an arithmetic type and matrix variable (C++).
| VarMat | A matrix of vars or a var with an underlying matrix type. |
| Arith | A type with an arithmetic Scalar type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 168 of file operator_addition.hpp.
|
inline |
Addition operator for an arithmetic matrix and variable (C++).
| Var | A var_value with an underlying arithmetic type. |
| EigMat | An Eigen Matrix type with an arithmetic Scalar type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 184 of file operator_addition.hpp.
|
inline |
Addition operator for a variable and arithmetic matrix (C++).
| EigMat | An Eigen Matrix type with an arithmetic Scalar type. |
| Var | A var_value with an underlying arithmetic type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 203 of file operator_addition.hpp.
|
inline |
Addition operator for a variable and variable matrix (C++).
| Var | A var_value with an underlying arithmetic type. |
| VarMat | An Eigen Matrix type with a variable Scalar type or a var_value with an underlying matrix type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 220 of file operator_addition.hpp.
|
inline |
Addition operator for a variable matrix and variable (C++).
| VarMat | An Eigen Matrix type with a variable Scalar type or a var_value with an underlying matrix type. |
| Var | A var_value with an underlying arithmetic type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 249 of file operator_addition.hpp.
|
inline |
Definition at line 256 of file operator_addition.hpp.
|
inline |
Definition at line 262 of file operator_addition.hpp.
|
inline |
Returns a Matrix with values added along the main diagonal.
| T_m | type of input kernel generator expression for the input matrix |
| T_a | type of input kernel generator expression to add along the diagonal |
| mat | input kernel generator expression |
| to_add | scalar value or input kernel generator expression to add along the diagonal |
Definition at line 27 of file add_diag.hpp.
|
inline |
Returns a Matrix with values added along the main diagonal.
| T_m | type of element in Eigen::Matrix |
| T_a | Type of element(s) to add along the diagonal |
| mat | a matrix |
| to_add | scalar value or column vector or row vector to add along the diagonal |
Definition at line 29 of file add_diag.hpp.
|
inline |
Returns a Matrix with values added along the main diagonal.
| T_m | type of input kernel generator expression for the input matrix |
| T_a | type of input kernel generator expression to add along the diagonal |
| mat | input kernel generator expression |
| to_add | scalar value or input kernel generator expression to add along the diagonal |
Definition at line 31 of file add_diag.hpp.
| auto& stan::math::adjoint_of | ( | const T & | x | ) |
Returns a reference to a variable's adjoint.
| x | a var |
x's adjoint Definition at line 37 of file adjoint_of.hpp.
| internal::nonexisting_adjoint stan::math::adjoint_of | ( | const T & | x | ) |
Returns a reference to a variable's adjoint.
If the input object is not var, it does not have an adjoint and this returns a dummy object. It defines operators += and -=, but they should not actually be called.
| x | any non-var object |
Definition at line 50 of file adjoint_of.hpp.
| adjoint_results_cl<T_results...> stan::math::adjoint_results | ( | T_results &&... | results | ) |
Deduces types for constructing adjoint_results_cl object.
| T_results | types of results |
| results | results that will be calculated. |
Definition at line 145 of file adjoint_results.hpp.
| Eigen::Matrix<value_type_t<T2>, Eigen::Dynamic, 1> stan::math::algebra_solver | ( | const F & | f, |
| const T1 & | x, | ||
| const T2 & | y, | ||
| const std::vector< double > & | dat, | ||
| const std::vector< int > & | dat_int, | ||
| std::ostream * | msgs = nullptr, |
||
| const double | relative_tolerance = 1e-10, |
||
| const double | function_tolerance = 1e-6, |
||
| const int64_t | max_num_steps = 1e+3 |
||
| ) |
Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system.
Use Powell's dogleg solver.
The user can also specify the relative tolerance (xtol in Eigen's code), the function tolerance, and the maximum number of steps (maxfev in Eigen's code).
Signature to maintain backward compatibility, will be removed in the future.
| F | type of equation system function |
| T1 | type of elements in the x vector |
| T2 | type of elements in the y vector |
| [in] | f | Functor that evaluates the system of equations. |
| [in] | x | Vector of starting values (initial guess). |
| [in] | y | parameter vector for the equation system. |
| [in] | dat | continuous data vector for the equation system. |
| [in] | dat_int | integer data vector for the equation system. |
| [in,out] | msgs | the print stream for warning messages. |
| [in] | relative_tolerance | determines the convergence criteria for the solution. |
| [in] | function_tolerance | determines whether roots are acceptable. |
| [in] | max_num_steps | maximum number of function evaluations. |
| <code>std::invalid_argument</code> | if x has size zero. |
| <code>std::invalid_argument</code> | if x has non-finite elements. |
| <code>std::invalid_argument</code> | if y has non-finite elements. |
| <code>std::invalid_argument</code> | if dat has non-finite elements. |
| <code>std::invalid_argument</code> | if dat_int has non-finite elements. |
| <code>std::invalid_argument</code> | if relative_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if function_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if max_num_steps is not positive. |
| <code>boost::math::evaluation_error</code> | (which is a subclass of std::domain_error) if solver exceeds max_num_steps. |
| <code>boost::math::evaluation_error</code> | (which is a subclass of std::domain_error) if the norm of the solution exceeds the function tolerance. |
Definition at line 262 of file algebra_solver_powell.hpp.
| void stan::math::algebra_solver_check | ( | const Eigen::Matrix< T1, Eigen::Dynamic, 1 > & | x, |
| const Eigen::Matrix< T2, Eigen::Dynamic, 1 > | y, | ||
| const std::vector< double > & | dat, | ||
| const std::vector< int > & | dat_int, | ||
| double | function_tolerance, | ||
| long int | max_num_steps | ||
| ) |
Definition at line 101 of file algebra_system.hpp.
| Eigen::Matrix<T2, -1, 1> stan::math::algebra_solver_fp | ( | const F & | f, |
| const Eigen::Matrix< T1,-1, 1 > & | x, | ||
| const Eigen::Matrix< T2,-1, 1 > & | y, | ||
| const std::vector< double > & | x_r, | ||
| const std::vector< int > & | x_i, | ||
| const std::vector< T_u > & | u_scale, | ||
| const std::vector< T_f > & | f_scale, | ||
| std::ostream * | msgs = nullptr, |
||
| double | f_tol = 1e-8, |
||
| int | max_num_steps = 200 |
||
| ) |
Return a fixed pointer to the specified system of algebraic equations of form.
x = F(x; theta)
given an initial guess x, and parameters theta and data. Use the KINSOL solver from the SUNDIALS suite.
The user can also specify the scaling controls, the function tolerance, and the maximum number of steps.
| F | type of equation system function. |
| T | type of initial guess vector. The final solution type doesn't depend on initial guess type, but we allow initial guess to be either data or param. |
| T_u | type of scaling vector for unknowns. We allow it to be var because scaling could be parameter dependent. Internally these params are converted to data because scaling is applied. |
| T_f | type of scaling vector for residual. We allow it to be var because scaling could be parameter dependent. Internally these params are converted to data because scaling is applied. |
| [in] | f | Functor that evaluated the system of equations. |
| [in] | x | Vector of starting values. |
| [in] | y | Parameter vector for the equation system. The function is overloaded to treat y as a vector of doubles or of a a template type T. |
| [in] | x_r | Continuous data vector for the equation system. |
| [in] | x_i | Integer data vector for the equation system. |
| [in,out] | msgs | The print stream for warning messages. |
| [in] | u_scale | diagonal scaling matrix elements Du such that Du*x has all components roughly the same magnitude when x is close to a solution. (ref. KINSOL user guide chap.2 sec. "Scaling") |
| [in] | f_scale | diagonal scaling matrix elements such that Df*(x-f(x)) has all components roughly the same magnitude when x is not too close to a solution. (ref. KINSOL user guide chap.2 sec. "Scaling") |
| [in] | f_tol | Function-norm stopping tolerance. |
| [in] | max_num_steps | maximum number of function evaluations. |
| <code>std::invalid_argument</code> | if x has size zero. |
| <code>std::invalid_argument</code> | if x has non-finite elements. |
| <code>std::invalid_argument</code> | if y has non-finite elements. |
| <code>std::invalid_argument</code> | if dat has non-finite elements. |
| <code>std::invalid_argument</code> | if dat_int has non-finite elements. |
| <code>std::invalid_argument</code> | if scaled_step_size is strictly negative. |
| <code>std::invalid_argument</code> | if function_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if max_num_steps is not positive. |
| <code>boost::math::evaluation_error</code> | (which is a subclass of std::runtime_error) if solver exceeds max_num_steps. |
Definition at line 365 of file algebra_solver_fp.hpp.
| Eigen::Matrix<scalar_type_t<T2>, Eigen::Dynamic, 1> stan::math::algebra_solver_newton | ( | const F & | f, |
| const T1 & | x, | ||
| const T2 & | y, | ||
| const std::vector< double > & | dat, | ||
| const std::vector< int > & | dat_int, | ||
| std::ostream *const | msgs = nullptr, |
||
| const double | scaling_step_size = 1e-3, |
||
| const double | function_tolerance = 1e-6, |
||
| const long int | max_num_steps = 200 |
||
| ) |
Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system.
Use the KINSOL solver from the SUNDIALS suite.
The user can also specify the scaled step size, the function tolerance, and the maximum number of steps.
Signature to maintain backward compatibility, will be removed in the future.
| F | type of equation system function. |
| T | type of initial guess vector. |
| [in] | f | Functor that evaluated the system of equations. |
| [in] | x | Vector of starting values. |
| [in] | y | Parameter vector for the equation system. |
| [in] | dat | Continuous data vector for the equation system. |
| [in] | dat_int | Integer data vector for the equation system. |
| [in,out] | msgs | The print stream for warning messages. |
| [in] | scaling_step_size | Scaled-step stopping tolerance. If a Newton step is smaller than the scaling step tolerance, the code breaks, assuming the solver is no longer making significant progress (i.e. is stuck) |
| [in] | function_tolerance | determines whether roots are acceptable. |
| [in] | max_num_steps | maximum number of function evaluations. |
| <code>std::invalid_argument</code> | if x has size zero. |
| <code>std::invalid_argument</code> | if x has non-finite elements. |
| <code>std::invalid_argument</code> | if y has non-finite elements. |
| <code>std::invalid_argument</code> | if dat has non-finite elements. |
| <code>std::invalid_argument</code> | if dat_int has non-finite elements. |
| <code>std::invalid_argument</code> | if scaled_step_size is strictly negative. |
| <code>std::invalid_argument</code> | if function_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if max_num_steps is not positive. |
| <code>std::domain_error | if solver exceeds max_num_steps. |
Definition at line 248 of file algebra_solver_newton.hpp.
| Eigen::VectorXd stan::math::algebra_solver_newton_impl | ( | const F & | f, |
| const T & | x, | ||
| std::ostream *const | msgs, | ||
| const double | scaling_step_size, | ||
| const double | function_tolerance, | ||
| const int64_t | max_num_steps, | ||
| const Args &... | args | ||
| ) |
Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system.
Use the KINSOL solver from the SUNDIALS suite.
The user can also specify the scaled step size, the function tolerance, and the maximum number of steps.
This overload handles non-autodiff parameters.
| F | type of equation system function. |
| T | type of initial guess vector. |
| Args | types of additional parameters to the equation system functor |
| [in] | f | Functor that evaluated the system of equations. |
| [in] | x | Vector of starting values. |
| [in,out] | msgs | The print stream for warning messages. |
| [in] | scaling_step_size | Scaled-step stopping tolerance. If a Newton step is smaller than the scaling step tolerance, the code breaks, assuming the solver is no longer making significant progress (i.e. is stuck) |
| [in] | function_tolerance | determines whether roots are acceptable. |
| [in] | max_num_steps | maximum number of function evaluations. |
| [in] | args | Additional parameters to the equation system functor. |
| <code>std::invalid_argument</code> | if x has size zero. |
| <code>std::invalid_argument</code> | if x has non-finite elements. |
| <code>std::invalid_argument</code> | if scaled_step_size is strictly negative. |
| <code>std::invalid_argument</code> | if function_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if max_num_steps is not positive. |
| <code>std::domain_error | if solver exceeds max_num_steps. |
Definition at line 58 of file algebra_solver_newton.hpp.
| Eigen::Matrix<var, Eigen::Dynamic, 1> stan::math::algebra_solver_newton_impl | ( | const F & | f, |
| const T & | x, | ||
| std::ostream *const | msgs, | ||
| const double | scaling_step_size, | ||
| const double | function_tolerance, | ||
| const int64_t | max_num_steps, | ||
| const T_Args &... | args | ||
| ) |
Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system.
Use the KINSOL solver from the SUNDIALS suite.
The user can also specify the scaled step size, the function tolerance, and the maximum number of steps.
This overload handles var parameters.
The Jacobian (J_{xy}) (i.e., Jacobian of unknown (x) w.r.t. the parameter (y)) is calculated given the solution as follows. Since [ f(x, y) = 0, ] we have ((J_{pq}) being the Jacobian matrix ( {dq} {dq})) [
J_{fx} J_{xy} = J_{fy}. ] Let (eta) be the adjoint with respect to (x); then to calculate [ J_{xy}, ] we solve [
| F | type of equation system function. |
| T | type of initial guess vector. |
| Args | types of additional parameters to the equation system functor |
| [in] | f | Functor that evaluated the system of equations. |
| [in] | x | Vector of starting values. |
| [in,out] | msgs | The print stream for warning messages. |
| [in] | scaling_step_size | Scaled-step stopping tolerance. If a Newton step is smaller than the scaling step tolerance, the code breaks, assuming the solver is no longer making significant progress (i.e. is stuck) |
| [in] | function_tolerance | determines whether roots are acceptable. |
| [in] | max_num_steps | maximum number of function evaluations. |
| [in] | args | Additional parameters to the equation system functor. |
| <code>std::invalid_argument</code> | if x has size zero. |
| <code>std::invalid_argument</code> | if x has non-finite elements. |
| <code>std::invalid_argument</code> | if scaled_step_size is strictly negative. |
| <code>std::invalid_argument</code> | if function_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if max_num_steps is not positive. |
| <code>std::domain_error | if solver exceeds max_num_steps. |
Definition at line 139 of file algebra_solver_newton.hpp.
| Eigen::Matrix<value_type_t<T2>, Eigen::Dynamic, 1> stan::math::algebra_solver_powell | ( | const F & | f, |
| const T1 & | x, | ||
| const T2 & | y, | ||
| const std::vector< double > & | dat, | ||
| const std::vector< int > & | dat_int, | ||
| std::ostream *const | msgs = nullptr, |
||
| const double | relative_tolerance = 1e-10, |
||
| const double | function_tolerance = 1e-6, |
||
| const int64_t | max_num_steps = 1e+3 |
||
| ) |
Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system.
Use Powell's dogleg solver.
The user can also specify the relative tolerance (xtol in Eigen's code), the function tolerance, and the maximum number of steps (maxfev in Eigen's code).
| F | type of equation system function |
| T1 | type of elements in the x vector |
| T2 | type of elements in the y vector |
| [in] | f | Functor that evaluates the system of equations. |
| [in] | x | Vector of starting values (initial guess). |
| [in] | y | parameter vector for the equation system. |
| [in] | dat | continuous data vector for the equation system. |
| [in] | dat_int | integer data vector for the equation system. |
| [in,out] | msgs | the print stream for warning messages. |
| [in] | relative_tolerance | determines the convergence criteria for the solution. |
| [in] | function_tolerance | determines whether roots are acceptable. |
| [in] | max_num_steps | maximum number of function evaluations. |
| <code>std::invalid_argument</code> | if x has size zero. |
| <code>std::invalid_argument</code> | if x has non-finite elements. |
| <code>std::invalid_argument</code> | if y has non-finite elements. |
| <code>std::invalid_argument</code> | if dat has non-finite elements. |
| <code>std::invalid_argument</code> | if dat_int has non-finite elements. |
| <code>std::invalid_argument</code> | if relative_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if function_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if max_num_steps is not positive. |
| <code>std::domain_error</code> | solver exceeds max_num_steps. |
| <code>std::domain_error</code> | if the norm of the solution exceeds the function tolerance. |
Definition at line 202 of file algebra_solver_powell.hpp.
| T& stan::math::algebra_solver_powell_call_solver | ( | const F & | f, |
| T & | x, | ||
| std::ostream *const | msgs, | ||
| const double | relative_tolerance, | ||
| const double | function_tolerance, | ||
| const int64_t | max_num_steps, | ||
| const Args &... | args | ||
| ) |
Solve algebraic equations using Powell solver.
| F | type of equation system function |
| T | type of elements in the x vector |
| Args | types of additional parameters to the equation system functor |
| [in] | f | Functor that evaluates the system of equations |
| [in] | x | Vector of starting values (initial guess). |
| [in,out] | msgs | the print stream for warning messages. |
| [in] | relative_tolerance | determines the convergence criteria for the solution. |
| [in] | function_tolerance | determines whether roots are acceptable. |
| [in] | max_num_steps | maximum number of function evaluations. |
| [in] | args | additional parameters to the equation system functor. |
| <code>std::domain_error</code> | solver exceeds max_num_steps. |
| <code>std::domain_error</code> | if the norm of the solution exceeds the function tolerance. |
Definition at line 48 of file algebra_solver_powell.hpp.
| Eigen::VectorXd stan::math::algebra_solver_powell_impl | ( | const F & | f, |
| const T & | x, | ||
| std::ostream *const | msgs, | ||
| const double | relative_tolerance, | ||
| const double | function_tolerance, | ||
| const int64_t | max_num_steps, | ||
| const Args &... | args | ||
| ) |
Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system.
Use Powell's dogleg solver.
The user can also specify the relative tolerance (xtol in Eigen's code), the function tolerance, and the maximum number of steps (maxfev in Eigen's code).
This overload handles non-autodiff parameters.
| F | type of equation system function |
| T | type of elements in the x vector |
| Args | types of additional parameters to the equation system functor |
| [in] | f | Functor that evaluates the system of equations. |
| [in] | x | Vector of starting values (initial guess). |
| [in,out] | msgs | the print stream for warning messages. |
| [in] | relative_tolerance | determines the convergence criteria for the solution. |
| [in] | function_tolerance | determines whether roots are acceptable. |
| [in] | max_num_steps | maximum number of function evaluations. |
| [in] | args | additional parameters to the equation system functor. |
| <code>std::invalid_argument</code> | if x has size zero. |
| <code>std::invalid_argument</code> | if x has non-finite elements. elements. |
| <code>std::invalid_argument</code> | if relative_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if function_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if max_num_steps is not positive. |
| <code>std::domain_error</code> | solver exceeds max_num_steps. |
| <code>std::domain_error</code> | if the norm of the solution exceeds the function tolerance. |
Definition at line 129 of file algebra_solver_powell.hpp.
| Eigen::Matrix<var, Eigen::Dynamic, 1> stan::math::algebra_solver_powell_impl | ( | const F & | f, |
| const T & | x, | ||
| std::ostream *const | msgs, | ||
| const double | relative_tolerance, | ||
| const double | function_tolerance, | ||
| const int64_t | max_num_steps, | ||
| const T_Args &... | args | ||
| ) |
Return the solution to the specified system of algebraic equations given an initial guess, and parameters and data, which get passed into the algebraic system.
Use Powell's dogleg solver.
The user can also specify the relative tolerance (xtol in Eigen's code), the function tolerance, and the maximum number of steps (maxfev in Eigen's code).
This overload handles var parameters.
The Jacobian (J_{xy}) (i.e., Jacobian of unknown (x) w.r.t. the parameter (y)) is calculated given the solution as follows. Since [ f(x, y) = 0, ] we have ((J_{pq}) being the Jacobian matrix ( {dq} {dq})) [
J_{fx} J_{xy} = J_{fy}. ] Let (eta) be the adjoint with respect to (x); then to calculate [ J_{xy}, ] we solve [
| F | type of equation system function |
| T | type of elements in the x vector |
| Args | types of additional parameters to the equation system functor |
| [in] | f | Functor that evaluates the system of equations. |
| [in] | x | Vector of starting values (initial guess). |
| [in,out] | msgs | the print stream for warning messages. |
| [in] | relative_tolerance | determines the convergence criteria for the solution. |
| [in] | function_tolerance | determines whether roots are acceptable. |
| [in] | max_num_steps | maximum number of function evaluations. |
| [in] | args | Additional parameters to the equation system functor. |
| <code>std::invalid_argument</code> | if x has size zero. |
| <code>std::invalid_argument</code> | if x has non-finite elements. elements. |
| <code>std::invalid_argument</code> | if relative_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if function_tolerance is strictly negative. |
| <code>std::invalid_argument</code> | if max_num_steps is not positive. |
| <code>std::domain_error</code> | solver exceeds max_num_steps. |
| <code>std::domain_error</code> | if the norm of the solution exceeds the function tolerance. |
Definition at line 335 of file algebra_solver_powell.hpp.
|
inline |
Return the concatenation of two specified vectors in the order of the arguments.
| T1 | type of elements in first vector |
| T2 | type of elements in second vector |
| x | First vector |
| y | Second vector |
Definition at line 24 of file append_array.hpp.
|
inline |
Return the concatenation of two specified vectors in the order of the arguments.
The return type is computed with append_return_type
| T1 | type of elements in first vector |
| T2 | type of elements in second vector |
| x | First vector |
| y | Second vector |
Definition at line 29 of file append_array.hpp.
|
inline |
Return the concatenation of two specified vectors in the order of the arguments.
| T1 | type of elements in both vectors |
| x | First vector |
| y | Second vector |
Definition at line 59 of file append_array.hpp.
|
inline |
Return the result of appending the second argument matrix after the first argument matrix, that is, putting them side by side, with the first matrix followed by the second matrix.
Given input types result in following outputs: (matrix, matrix) -> matrix, (matrix, vector) -> matrix, (vector, matrix) -> matrix, (vector, vector) -> matrix, (row vector, row vector) -> row_vector.
| T1 | type of the first matrix |
| T2 | type of the second matrix |
| A | First matrix. |
| B | Second matrix. |
Given input types result in following outputs: (matrix, matrix) -> matrix, (matrix, vector) -> matrix, (vector, matrix) -> matrix, (vector, vector) -> matrix, (row vector, row vector) -> row_vector.
| A | First matrix. |
| B | Second matrix. |
Definition at line 33 of file append_col.hpp.
|
inline |
Return the result of appending the second argument matrix after the first argument matrix, that is, putting them side by side, with the first matrix followed by the second matrix.
Given input types result in following outputs: (matrix, matrix) -> matrix, (matrix, vector) -> matrix, (vector, matrix) -> matrix, (vector, vector) -> matrix, (row vector, row vector) -> row_vector.
| T_a | type of the first matrix |
| T_b | type of the second matrix |
| a | First matrix. |
| b | Second matrix. |
Definition at line 42 of file append_col.hpp.
|
inline |
Return the result of stacking an scalar on top of the a row vector, with the result being a row vector.
This function applies to (scalar, row vector) and returns a row vector.
| Scal | type of the scalar |
| RowVec | type of the row vector |
| A | scalar. |
| B | row vector. |
Definition at line 71 of file append_col.hpp.
|
inline |
Return the result of stacking an scalar on top of the a row vector, with the result being a row vector.
This function applies to (scalar, row vector) and returns a row vector.
| Scal | type of the scalar |
| RowVec | A var_value with an inner type of row vector. |
| A | scalar. |
| B | row vector. |
Definition at line 81 of file append_col.hpp.
|
inline |
Return the result of stacking a row vector on top of the an scalar, with the result being a row vector.
This function applies to (row vector, scalar) and returns a row vector.
| RowVec | type of the row vector |
| Scal | type of the scalar |
| A | row vector. |
| B | scalar. |
Definition at line 99 of file append_col.hpp.
|
inline |
Return the result of stacking a row vector on top of the an scalar, with the result being a row vector.
This function applies to (row vector, scalar) and returns a row vector.
| RowVec | A var_value with an inner type of row vector. |
| Scal | type of the scalar |
| A | row vector. |
| B | scalar. |
Definition at line 121 of file append_col.hpp.
|
inline |
Return the result of stacking the rows of the first argument matrix on top of the second argument matrix.
Given input types result in following outputs: (matrix, matrix) -> matrix, (matrix, row_vector) -> matrix, (row_vector, matrix) -> matrix, (row_vector, row_vector) -> matrix, (vector, vector) -> vector.
| T1 | type of the first matrix |
| T2 | type of the second matrix |
| A | First matrix. |
| B | Second matrix. |
Given input types result in following outputs: (matrix, matrix) -> matrix, (matrix, row_vector) -> matrix, (row_vector, matrix) -> matrix, (row_vector, row_vector) -> matrix, (vector, vector) -> vector.
| A | First matrix. |
| B | Second matrix. |
Definition at line 31 of file append_row.hpp.
|
inline |
Return the result of stacking the rows of the first argument matrix on top of the second argument matrix.
Given input types result in following outputs: (matrix, matrix) -> matrix, (matrix, row_vector) -> matrix, (row_vector, matrix) -> matrix, (row_vector, row_vector) -> matrix, (vector, vector) -> vector.
| T_a | type of the first matrix |
| T_b | type of the second matrix |
| a | First matrix. |
| b | Second matrix. |
Definition at line 40 of file append_row.hpp.
|
inline |
Return the result of stacking an scalar on top of the a vector, with the result being a vector.
This function applies to (scalar, vector) and returns a vector.
| Scal | type of the scalar |
| ColVec | type of the vector |
| A | scalar. |
| B | vector. |
Definition at line 68 of file append_row.hpp.
|
inline |
Return the result of stacking an scalar on top of the a vector, with the result being a vector.
This function applies to (scalar, vector) and returns a vector.
| Scal | type of the scalar |
| ColVec | A var_value with inner column vector type. |
| A | scalar. |
| B | vector. |
Definition at line 78 of file append_row.hpp.
|
inline |
Return the result of stacking a vector on top of the an scalar, with the result being a vector.
This function applies to (vector, scalar) and returns a vector.
| ColVec | type of the vector |
| Scal | type of the scalar |
| A | vector. |
| B | scalar. |
Definition at line 95 of file append_row.hpp.
|
inline |
Return the result of stacking a vector on top of the an scalar, with the result being a vector.
This function applies to (vector, scalar) and returns a vector.
| ColVec | a var_value with inner column vector type. |
| Scal | type of the scalar |
| A | vector. |
| B | scalar. |
Definition at line 117 of file append_row.hpp.
| decltype(auto) constexpr stan::math::apply | ( | F && | f, |
| Tuple && | t | ||
| ) |
|
inline |
Base template function for vectorization of binary scalar functions defined by applying a functor to a combination of scalars, containers of matching sizes, or a combination of a scalar and a container.
Specialisation for use with two nested containers (std::vectors).
Specialisation for use with (non-nested) std::vectors.
Specialisation for use with two Eigen inputs.
These containers can be a standard library vector, Eigen dense matrix expression template, or container of these. For each specialisation, the same type as the largest (dimension) input is returned.
This base template function takes (and returns) scalars.
| T1 | Type of first argument to which functor is applied. |
| T2 | Type of second argument to which functor is applied. |
| F | Type of functor to apply. |
| x | First input to which operation is applied. |
| y | Second input to which operation is applied. |
| f | functor to apply to inputs. |
Eigen's binaryExpr framework is used for more efficient indexing of both row- and column-major inputs without separate loops.
| T1 | Type of first argument to which functor is applied. |
| T2 | Type of second argument to which functor is applied. |
| F | Type of functor to apply. |
| x | First Eigen input to which operation is applied. |
| y | Second Eigen input to which operation is applied. |
| f | functor to apply to Eigen input. |
Inputs are mapped to Eigen column vectors and then the result is evaluated directly into the returned std::vector (via Eigen::Map).
The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).
| T1 | Type of first std::vector to which functor is applied. |
| T2 | Type of second std::vector to which functor is applied. |
| F | Type of functor to apply. |
| x | First std::vector input to which operation is applied. |
| y | Second std::vector input to which operation is applied. |
| f | functor to apply to std::vector inputs. |
The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).
| T1 | Type of first std::vector to which functor is applied. |
| T2 | Type of second std::vector to which functor is applied. |
| F | Type of functor to apply. |
| x | First std::vector input to which operation is applied. |
| y | Second std::vector input to which operation is applied. |
| f | functor to apply to std::vector inputs. |
Definition at line 37 of file apply_scalar_binary.hpp.
|
inline |
Specialisation for use with one Eigen vector (row or column) and a one-dimensional std::vector of integer types.
Specialisation for use when the one input is an `var_value<Eigen> type and the other is a scalar.
Specialisation for use with one var_value<Eigen vector> (row or column) and a one-dimensional std::vector of integer types.
Specialisation for use with combinations of Eigen::Matrix and var_value<Eigen::Matrix> inputs.
Specialisation for use when the first input is a scalar and the second is a nested std::vector.
Specialisation for use when the first input is a nested std::vector and the second is a scalar.
Specialisation for use when the first input is a scalar and the second is a (non-nested) std::vector.
Specialisation for use when the first input is a (non-nested) std::vector and the second is a scalar.
Specialisation for use when the first input is an scalar and the second is an Eigen type.
Specialisation for use when the first input is an Eigen type and the second is a scalar.
Specialisation for use with a one-dimensional std::vector of integer types and one Eigen vector (row or column).
| T1 | Type of first argument to which functor is applied. |
| T2 | Type of second argument to which functor is applied. |
| F | Type of functor to apply. |
| x | Eigen input to which operation is applied. |
| y | Integer std::vector input to which operation is applied. |
| f | functor to apply to inputs. |
| T1 | Type of first argument to which functor is applied. |
| T2 | Type of second argument to which functor is applied. |
| F | Type of functor to apply. |
| x | Integer std::vector input to which operation is applied. |
| y | Eigen input to which operation is applied. |
| f | functor to apply to inputs. |
Eigen's unaryExpr framework is used for more efficient indexing of both row- and column-major inputs. The unaryExpr framework also allows for the scalar to be captured and applied to each element in the Eigen object.
| T1 | Type of Eigen object to which functor is applied. |
| T2 | Type of scalar to which functor is applied. |
| F | Type of functor to apply. |
| x | Eigen input to which operation is applied. |
| y | Scalar input to which operation is applied. |
| f | functor to apply to Eigen and scalar inputs. |
Note: The return expresssion needs to be evaluated, otherwise the captured function and scalar fall out of scope.
Eigen's unaryExpr framework is used for more efficient indexing of both row- and column-major inputs. The unaryExpr framework also allows for the scalar to be captured and applied to each element in the Eigen object.
| T1 | Type of scalar to which functor is applied. |
| T2 | Type of Eigen object to which functor is applied. |
| F | Type of functor to apply. |
| x | Scalar input to which operation is applied. |
| y | Eigen input to which operation is applied. |
| f | functor to apply to Eigen and scalar inputs. |
Note: The return expresssion needs to be evaluated, otherwise the captured function and scalar fall out of scope.
The std::vector input is mapped to an Eigen column vector and then the result is evaluated directly into the returned std::vector (via Eigen::Map).
The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).
| T1 | Type of std::vector to which functor is applied. |
| T2 | Type of scalar to which functor is applied. |
| F | Type of functor to apply. |
| x | std::vector input to which operation is applied. |
| y | Scalar input to which operation is applied. |
| f | functor to apply to std::vector and scalar inputs. |
The std::vector input is mapped to an Eigen column vector and then the result is evaluated directly into the returned std::vector (via Eigen::Map).
The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).
| T1 | Type of scalar to which functor is applied. |
| T2 | Type of std::vector to which functor is applied. |
| F | Type of functor to apply. |
| x | Scalar input to which operation is applied. |
| y | std::vector input to which operation is applied. |
| f | functor to apply to std::vector and scalar inputs. |
The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).
| T1 | Type of std::vector to which functor is applied. |
| T2 | Type of scalar to which functor is applied. |
| F | Type of functor to apply. |
| x | std::vector input to which operation is applied. |
| y | Scalar input to which operation is applied. |
| f | functor to apply to inputs. |
The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).
| T1 | Type of scalar to which functor is applied. |
| T2 | Type of std::vector to which functor is applied. |
| F | Type of functor to apply. |
| x | Scalar input to which operation is applied. |
| y | std::vector input to which operation is applied. |
| f | functor to apply to inputs. |
Eigen's binaryExpr framework is used for more efficient indexing of both row- and column-major inputs without separate loops.
| T1 | Type of first argument to which functor is applied. |
| T2 | Type of second argument to which functor is applied. |
| F | Type of functor to apply. |
| x | First Matrix input to which operation is applied. |
| y | Second Matrix input to which operation is applied. |
| f | functor to apply to Matrix inputs. |
var_value<Matrix> with result of applying functor to inputs.| T1 | Type of first argument to which functor is applied. |
| T2 | Type of second argument to which functor is applied. |
| F | Type of functor to apply. |
| x | Matrix input to which operation is applied. |
| y | Integer std::vector input to which operation is applied. |
| f | functor to apply to inputs. |
| T1 | Type of either var_value<Matrix> or scalar object to which functor is applied. |
| T2 | Type of either var_value<Matrix> or scalar object to which functor is applied. |
| F | Type of functor to apply. |
| x | Matrix or Scalar input to which operation is applied. |
| x | Matrix or Scalar input to which operation is applied. |
| f | functor to apply to var matrix and scalar inputs. |
Definition at line 76 of file apply_scalar_binary.hpp.
|
inline |
Specialisation for use with one Eigen matrix and a two-dimensional std::vector of integer types.
Specialisation for use with a two-dimensional std::vector of integer types and one var_value<Matrix>.
Specialisation for use with a two-dimensional std::vector of integer types and one Eigen matrix.
| T1 | Type of first argument to which functor is applied. |
| T2 | Type of second argument to which functor is applied. |
| F | Type of functor to apply. |
| x | Eigen matrix input to which operation is applied. |
| y | Nested integer std::vector input to which operation is applied. |
| f | functor to apply to inputs. |
| T1 | Type of first argument to which functor is applied. |
| T2 | Type of second argument to which functor is applied. |
| F | Type of functor to apply. |
| x | Nested integer std::vector input to which operation is applied. |
| y | Eigen matrix input to which operation is applied. |
| f | functor to apply to inputs. |
| T1 | Type of first argument to which functor is applied. |
| T2 | Type of second argument to which functor is applied. |
| F | Type of functor to apply. |
| x | Either a var matrix or nested integer std::vector input to which operation is applied. |
| x | Either a var matrix or nested integer std::vector input to which operation is applied. |
| f | functor to apply to inputs. |
Definition at line 121 of file apply_scalar_binary.hpp.
|
inline |
Returns specified input value.
| T | Type of element. |
| v | Specified value. |
Definition at line 19 of file as_array_or_scalar.hpp.
|
inline |
Converts a var_value<T> with inner Eigen matrix type to an var_value<T> with an inner array.
| T | Type of var_value<T> with inner Eigen::Matrix or expression |
| v | Specified var_value<T> with inner Eigen::Matrix or expression. |
var_value<> with Matrix converted to an array. Definition at line 20 of file as_array_or_scalar.hpp.
|
inline |
Returns a reference to rvalue specified input value.
| T | Type of element. |
| v | Specified value. |
Definition at line 31 of file as_array_or_scalar.hpp.
|
inline |
Converts a matrix type to an array.
Converts an std::vector<std::vector> to an Eigen Array.
Converts a std::vector type to an array.
| T | Type of Eigen Matrix or expression |
| v | Specified Eigen Matrix or expression. |
| T | Type of scalar element. |
| v | Specified vector. |
| T | A standard vector with inner container of a standard vector with an inner stan scalar. |
| v | specified vector of vectorised |
Definition at line 56 of file as_array_or_scalar.hpp.
|
inline |
Return 1 if the argument is unequal to zero and 0 otherwise.
| v | Value. |
Definition at line 16 of file as_bool.hpp.
|
inline |
Return true if the argument is not equal to zero (in the != operator sense) and false otherwise.
| T | type of scalar |
| x | value |
Definition at line 17 of file as_bool.hpp.
|
inline |
Converts kernel generator expression row or column vector to a column vector.
| T | kernel generator expression. |
| m | Specified input. |
Definition at line 22 of file as_column_vector_or_scalar.hpp.
|
inline |
no-op that passes the scalar
| T | Type of scalar element. |
| a | Specified scalar. |
Definition at line 22 of file as_column_vector_or_scalar.hpp.
| internal::empty_broadcast_array<T, S, void>& stan::math::as_column_vector_or_scalar | ( | internal::empty_broadcast_array< T, S, void > & | a | ) |
No-op used when working with operands and partials.
This is not implimented so it cannot be invoked and only exists so the compiler can resolve it's output type.
|
inline |
no-op that returns a column vector.
| T | Type inheriting from EigenBase with dynamic compile time rows and fixed column of 1. |
| a | Specified vector. |
Definition at line 44 of file as_column_vector_or_scalar.hpp.
|
inline |
Converts a row vector to an eigen column vector.
Converts var_value with row vector inner type to a var_value<> with inner column vector type.
For row vectors this returns a Transpose<Eigen::Matrix<T, 1, -1>>.
| T | Type inheriting from EigenBase with dynamic compile time columns and fixed row of 1. |
| a | Specified vector. |
| T | A var_value<> with an inner row vector type. |
| a | Specified vector. |
Definition at line 59 of file as_column_vector_or_scalar.hpp.
|
inline |
Extract the value from an object.
For eigen types and std::vectors convert to an eigen array and for scalars return a scalar.
| T | A stan scalar, eigen vector, or std::vector. |
| v | Specified value. |
Definition at line 21 of file as_value_array_or_scalar.hpp.
|
inline |
Extract the value from an object and for eigen vectors and std::vectors convert to an eigen column array and for scalars return a scalar.
| T | A stan scalar, eigen vector, or std::vector. |
| a | Specified scalar. |
Definition at line 22 of file as_value_column_array_or_scalar.hpp.
|
inline |
Extract values from input argument and transform to a column vector.
For scalar this returns a scalar. For arithmetic types this is an identity function.
| T | Type of scalar element. |
| a | Specified scalar. |
Definition at line 23 of file as_value_column_vector_or_scalar.hpp.
|
inline |
Return the principal value of the arc sine, in radians, of the specified variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \arcsin x = \frac{1}{\sqrt{1 - x^2}}\).
\[ \mbox{asin}(x) = \begin{cases} \textrm{NaN} & \mbox{if } x < -1\\ \arcsin(x) & \mbox{if } -1\leq x\leq 1 \\ \textrm{NaN} & \mbox{if } x > 1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{asin}(x)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < -1\\ \frac{\partial\, \arcsin(x)}{\partial x} & \mbox{if } -1\leq x\leq 1 \\ \textrm{NaN} & \mbox{if } x < -1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial \, \arcsin(x)}{\partial x} = \frac{1}{\sqrt{1-x^2}} \]
| x | Variable in range [-1, 1]. |
|
inline |
|
inline |
|
inline |
The inverse hyperbolic sine function for variables (C99).
The derivative is defined by
\(\frac{d}{dx} \mbox{asinh}(x) = \frac{x}{x^2 + 1}\).
\[ \mbox{asinh}(x) = \begin{cases} \sinh^{-1}(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{asinh}(x)}{\partial x} = \begin{cases} \frac{\partial\, \sinh^{-1}(x)}{\partial x} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \sinh^{-1}(x)=\ln\left(x+\sqrt{x^2+1}\right) \]
\[ \frac{\partial \, \sinh^{-1}(x)}{\partial x} = \frac{1}{\sqrt{x^2+1}} \]
| x | The variable. |
|
inline |
|
inline |
Copy the right-hand side's value to the left-hand side variable.
The assign() function is overloaded. This instance will match arguments where the right-hand side is assignable to the left and they are not both std::vector or Eigen::Matrix types.
| T_lhs | Type of left-hand side. |
| T_rhs | Type of right-hand side. |
| x | Left-hand side. |
| y | Right-hand side. |
Definition at line 46 of file assign.hpp.
|
inline |
Copy the right-hand side's value to the left-hand side variable.
The assign() function is overloaded. This instance will be called for arguments that are both Eigen::Matrix types.
| T_lhs | type of the left-hand side matrix |
| T_rhs | type of the right-hand side matrix |
| x | Left-hand side matrix. |
| y | Right-hand side matrix. |
| std::invalid_argument | if sizes do not match. |
Definition at line 67 of file assign.hpp.
|
inline |
Copy the right-hand side's value to the left-hand side variable.
The assign() function is overloaded. This instance will be called for arguments that are both std::vector, and will call assign() element-by element.
For example, a std::vector<int> can be assigned to a std::vector<double> using this function.
| T_lhs | type of elements in the left-hand side vector |
| T_rhs | type of elements in the right-hand side vector |
| x | Left-hand side vector. |
| y | Right-hand side vector. |
| std::invalid_argument | if sizes do not match. |
Definition at line 92 of file assign.hpp.
|
inline |
Return the principal value of the arc tangent, in radians, of the specified variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \arctan x = \frac{1}{1 + x^2}\).
\[ \mbox{atan}(x) = \begin{cases} \arctan(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{atan}(x)}{\partial x} = \begin{cases} \frac{\partial\, \arctan(x)}{\partial x} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial \, \arctan(x)}{\partial x} = \frac{1}{x^2+1} \]
| x | Variable in range [-1, 1]. |
|
inline |
|
inline |
Return the principal value of the arc tangent, in radians, of the first variable divided by the second (cmath).
The partial derivatives are defined by
\( \frac{\partial}{\partial x} \arctan \frac{x}{y} = \frac{y}{x^2 + y^2}\), and
\( \frac{\partial}{\partial y} \arctan \frac{x}{y} = \frac{-x}{x^2 + y^2}\).
| a | Numerator variable. |
| b | Denominator variable. |
Return the principal value of the arc tangent, in radians, of the first variable divided by the second scalar (cmath).
The derivative with respect to the variable is
\( \frac{d}{d x} \arctan \frac{x}{c} = \frac{c}{x^2 + c^2}\).
| a | Numerator variable. |
| b | Denominator scalar. |
Return the principal value of the arc tangent, in radians, of the first scalar divided by the second variable (cmath).
The derivative with respect to the variable is
\( \frac{\partial}{\partial y} \arctan \frac{c}{y} = \frac{-c}{c^2 + y^2}\).
\[ \mbox{atan2}(x, y) = \begin{cases} \arctan\left(\frac{x}{y}\right) & \mbox{if } -\infty\leq x \leq \infty, -\infty\leq y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{atan2}(x, y)}{\partial x} = \begin{cases} \frac{y}{x^2+y^2} & \mbox{if } -\infty\leq x\leq \infty, -\infty\leq y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{atan2}(x, y)}{\partial y} = \begin{cases} -\frac{x}{x^2+y^2} & \mbox{if } -\infty\leq x\leq \infty, -\infty\leq y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | Numerator scalar. |
| b | Denominator variable. |
|
inline |
Return the inverse hyperbolic tangent of the specified value.
An argument of -1 returns negative infinity and an argument of 1 returns infinity. Returns nan for nan argument.
| [in] | x | Argument. |
| std::domain_error | If argument is not in [-1, 1]. |
|
inline |
The inverse hyperbolic tangent function for variables (C99).
The derivative is defined by
\(\frac{d}{dx} \mbox{atanh}(x) = \frac{1}{1 - x^2}\).
\[ \mbox{atanh}(x) = \begin{cases} \textrm{NaN} & \mbox{if } x < -1\\ \tanh^{-1}(x) & \mbox{if } -1\leq x \leq 1 \\ \textrm{NaN} & \mbox{if } x > 1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{atanh}(x)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < -1\\ \frac{\partial\, \tanh^{-1}(x)}{\partial x} & \mbox{if } -1\leq x\leq 1 \\ \textrm{NaN} & \mbox{if } x > 1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \tanh^{-1}(x)=\frac{1}{2}\ln\left(\frac{1+x}{1-x}\right) \]
\[ \frac{\partial \, \tanh^{-1}(x)}{\partial x} = \frac{1}{1-x^2} \]
| x | The variable. |
| std::domain_error | if a < -1 or a > 1 |
|
inline |
|
inline |
Return the elementwise application of atanh() to specified argument container.
The return type promotes the underlying scalar argument type to double if it is an integer, and otherwise is the argument type.
| T | type of container |
| x | container |
| void stan::math::autocorrelation | ( | const std::vector< T > & | y, |
| std::vector< T > & | ac, | ||
| Eigen::FFT< T > & | fft | ||
| ) |
Write autocorrelation estimates for every lag for the specified input sequence into the specified result using the specified FFT engine.
The return vector be resized to the same length as the input sequence with lags given by array index.
The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.
An FFT engine can be created for reuse for type double with:
Eigen::FFT<double> fft;
| T | Scalar type. |
| y | Input sequence. |
| ac | Autocorrelations. |
| fft | FFT engine instance. |
Definition at line 62 of file autocorrelation.hpp.
| void stan::math::autocorrelation | ( | const Eigen::MatrixBase< DerivedA > & | y, |
| Eigen::MatrixBase< DerivedB > & | ac, | ||
| Eigen::FFT< T > & | fft | ||
| ) |
Write autocorrelation estimates for every lag for the specified input sequence into the specified result using the specified FFT engine.
The return vector be resized to the same length as the input sequence with lags given by array index.
The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.
An FFT engine can be created for reuse for type double with:
Eigen::FFT<double> fft;
| T | Scalar type. |
| y | Input sequence. |
| ac | Autocorrelations. |
| fft | FFT engine instance. |
Definition at line 119 of file autocorrelation.hpp.
| void stan::math::autocorrelation | ( | const std::vector< T > & | y, |
| std::vector< T > & | ac | ||
| ) |
Write autocorrelation estimates for every lag for the specified input sequence into the specified result.
The return vector be resized to the same length as the input sequence with lags given by array index.
The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.
This method is just a light wrapper around the three-argument autocorrelation function.
| T | Scalar type. |
| y | Input sequence. |
| ac | Autocorrelations. |
Definition at line 164 of file autocorrelation.hpp.
| void stan::math::autocorrelation | ( | const Eigen::MatrixBase< DerivedA > & | y, |
| Eigen::MatrixBase< DerivedB > & | ac | ||
| ) |
Write autocorrelation estimates for every lag for the specified input sequence into the specified result.
The return vector be resized to the same length as the input sequence with lags given by array index.
The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.
This method is just a light wrapper around the three-argument autocorrelation function
| T | Scalar type. |
| y | Input sequence. |
| ac | Autocorrelations. |
Definition at line 191 of file autocorrelation.hpp.
| void stan::math::autocovariance | ( | const std::vector< T > & | y, |
| std::vector< T > & | acov, | ||
| Eigen::FFT< T > & | fft | ||
| ) |
Write autocovariance estimates for every lag for the specified input sequence into the specified result using the specified FFT engine.
The return vector be resized to the same length as the input sequence with lags given by array index.
The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.
An FFT engine can be created for reuse for type double with:
Eigen::FFT<double> fft;
| T | Scalar type. |
| y | Input sequence. |
| acov | Autocovariance. |
| fft | FFT engine instance. |
Definition at line 33 of file autocovariance.hpp.
| void stan::math::autocovariance | ( | const Eigen::MatrixBase< DerivedA > & | y, |
| Eigen::MatrixBase< DerivedB > & | acov, | ||
| Eigen::FFT< T > & | fft | ||
| ) |
Write autocovariance estimates for every lag for the specified input sequence into the specified result using the specified FFT engine.
The return vector be resized to the same length as the input sequence with lags given by array index.
The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.
An FFT engine can be created for reuse for type double with:
Eigen::FFT<double> fft;
| T | scalar type |
| DerivedA | type of the first matrix |
| DerivedB | type of the second matrix |
| y | Input sequence. |
| acov | Autocovariance. |
| fft | FFT engine instance. |
Definition at line 66 of file autocovariance.hpp.
| void stan::math::autocovariance | ( | const std::vector< T > & | y, |
| std::vector< T > & | acov | ||
| ) |
Write autocovariance estimates for every lag for the specified input sequence into the specified result.
The return vector be resized to the same length as the input sequence with lags given by array index.
The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.
This method is just a light wrapper around the three-argument autocovariance function.
| T | Scalar type. |
| y | Input sequence. |
| acov | Autocovariances. |
Definition at line 89 of file autocovariance.hpp.
| void stan::math::autocovariance | ( | const Eigen::MatrixBase< DerivedA > & | y, |
| Eigen::MatrixBase< DerivedB > & | acov | ||
| ) |
Write autocovariance estimates for every lag for the specified input sequence into the specified result.
The return vector be resized to the same length as the input sequence with lags given by array index.
The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.
This method is just a light wrapper around the three-argument autocovariance function
| T | scalar type |
| DerivedA | type of the first matrix |
| DerivedB | type of the second matrix |
| y | Input sequence. |
| acov | Autocovariances. |
Definition at line 118 of file autocovariance.hpp.
|
inline |
Definition at line 166 of file bernoulli_logit_glm_lpmf.hpp.
|
inline |
Definition at line 92 of file bernoulli_logit_lpmf.hpp.
|
inline |
Definition at line 115 of file bernoulli_lpmf.hpp.
Definition at line 11 of file bessel_first_kind.hpp.
Definition at line 12 of file bessel_first_kind.hpp.
|
inline |
Overload with var_value<Matrix> for int, std::vector<int>, and std::vector<std::vector<int>>
Definition at line 27 of file bessel_first_kind.hpp.
|
inline |
\[ \mbox{bessel\_first\_kind}(v, x) = \begin{cases} J_v(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{error} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{bessel\_first\_kind}(v, x)}{\partial x} = \begin{cases} \frac{\partial\, J_v(x)}{\partial x} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{error} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ J_v(x)=\left(\frac{1}{2}x\right)^v \sum_{k=0}^\infty \frac{\left(-\frac{1}{4}x^2\right)^k}{k!\, \Gamma(v+k+1)} \]
\[ \frac{\partial \, J_v(x)}{\partial x} = \frac{v}{x}J_v(x)-J_{v+1}(x) \]
Definition at line 39 of file bessel_first_kind.hpp.
|
inline |
Enables the vectorised application of the bessel first kind function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 56 of file bessel_first_kind.hpp.
Definition at line 11 of file bessel_second_kind.hpp.
Definition at line 12 of file bessel_second_kind.hpp.
|
inline |
Overload with var_value<Matrix> for int, std::vector<int>, and std::vector<std::vector<int>>
Definition at line 26 of file bessel_second_kind.hpp.
|
inline |
\[ \mbox{bessel\_second\_kind}(v, x) = \begin{cases} \textrm{error} & \mbox{if } x \leq 0 \\ Y_v(x) & \mbox{if } x > 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{bessel\_second\_kind}(v, x)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0 \\ \frac{\partial\, Y_v(x)}{\partial x} & \mbox{if } x > 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ Y_v(x)=\frac{J_v(x)\cos(v\pi)-J_{-v}(x)}{\sin(v\pi)} \]
\[ \frac{\partial \, Y_v(x)}{\partial x} = \frac{v}{x}Y_v(x)-Y_{v+1}(x) \]
Definition at line 41 of file bessel_second_kind.hpp.
|
inline |
Enables the vectorised application of the bessel second kind function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 56 of file bessel_second_kind.hpp.
|
inline |
Returns the beta function and gradients for two var inputs.
\[ \mathrm{beta}(a,b) = \left(B\left(a,b\right)\right) \]
\[ \frac{\partial }{\partial a} = \left(\psi^{\left(0\right)}\left(a\right) - \psi^{\left(0\right)} \left(a + b\right)\right) \mathrm{beta}(a,b) \]
\[ \frac{\partial }{\partial b} = \left(\psi^{\left(0\right)}\left(b\right) - \psi^{\left(0\right)} \left(a + b\right)\right) \mathrm{beta}(a,b) \]
| a | var Argument |
| b | var Argument |
|
inline |
Return fvar with the beta function applied to the specified arguments and its gradient.
The beta function is defined for \(a > 0\) and \(b > 0\) by
\(\mbox{B}(a, b) = \frac{\Gamma(a) \Gamma(b)}{\Gamma(a+b)}\).
\[ \mbox{beta}(\alpha, \beta) = \begin{cases} \int_0^1 u^{\alpha - 1} (1 - u)^{\beta - 1} \, du & \mbox{if } \alpha, \beta>0 \\[6pt] \textrm{NaN} & \mbox{if } \alpha = \textrm{NaN or } \beta = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{beta}(\alpha, \beta)}{\partial \alpha} = \begin{cases} \left(\psi(\alpha)-\psi(\alpha+\beta)\right)*\mbox{beta}(\alpha, \beta) & \mbox{if } \alpha, \beta>0 \\[6pt] \textrm{NaN} & \mbox{if } \alpha = \textrm{NaN or } \beta = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{beta}(\alpha, \beta)}{\partial \beta} = \begin{cases} \left(\psi(\beta)-\psi(\alpha+\beta)\right)*\mbox{beta}(\alpha, \beta) & \mbox{if } \alpha, \beta>0 \\[6pt] \textrm{NaN} & \mbox{if } \alpha = \textrm{NaN or } \beta = \textrm{NaN} \end{cases} \]
| T | inner type of the fvar |
| x1 | First value |
| x2 | Second value |
|
inline |
Return the beta function applied to the specified arguments.
The beta function is defined for \(a > 0\) and \(b > 0\) by
\(\mbox{B}(a, b) = \frac{\Gamma(a) \Gamma(b)}{\Gamma(a+b)}\).
\[ \mbox{beta}(\alpha, \beta) = \begin{cases} \int_0^1 u^{\alpha - 1} (1 - u)^{\beta - 1} \, du & \mbox{if } \alpha, \beta>0 \\[6pt] \textrm{NaN} & \mbox{if } \alpha = \textrm{NaN or } \beta = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{beta}(\alpha, \beta)}{\partial \alpha} = \begin{cases} \left(\psi(\alpha)-\psi(\alpha+\beta)\right)*\mbox{beta}(\alpha, \beta) & \mbox{if } \alpha, \beta>0 \\[6pt] \textrm{NaN} & \mbox{if } \alpha = \textrm{NaN or } \beta = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{beta}(\alpha, \beta)}{\partial \beta} = \begin{cases} \left(\psi(\beta)-\psi(\alpha+\beta)\right)*\mbox{beta}(\alpha, \beta) & \mbox{if } \alpha, \beta>0 \\[6pt] \textrm{NaN} & \mbox{if } \alpha = \textrm{NaN or } \beta = \textrm{NaN} \end{cases} \]
| T1 | type of first value |
| T2 | type of second value |
| a | First value |
| b | Second value |
Returns the beta function and gradient for first var input.
\[ \mathrm{beta}(a,b) = \left(B\left(a,b\right)\right) \]
\[ \frac{\partial }{\partial a} = \left(\psi^{\left(0\right)}\left(a\right) - \psi^{\left(0\right)} \left(a + b\right)\right) \mathrm{beta}(a,b) \]
| a | var Argument |
| b | double Argument |
|
inline |
Enables the vectorised application of the beta function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Returns the beta function and gradient for second var input.
\[ \mathrm{beta}(a,b) = \left(B\left(a,b\right)\right) \]
\[ \frac{\partial }{\partial b} = \left(\psi^{\left(0\right)}\left(b\right) - \psi^{\left(0\right)} \left(a + b\right)\right) \mathrm{beta}(a,b) \]
| a | double Argument |
| b | var Argument |
|
inline |
|
inline |
|
inline |
| return_type_t<T_size1, T_size2> stan::math::beta_binomial_lpmf | ( | const T_n & | n, |
| const T_N & | N, | ||
| const T_size1 & | alpha, | ||
| const T_size2 & | beta | ||
| ) |
Definition at line 171 of file beta_binomial_lpmf.hpp.
|
inline |
Definition at line 126 of file beta_lpdf.hpp.
|
inline |
Definition at line 128 of file beta_proportion_lpdf.hpp.
Definition at line 12 of file binary_log_loss.hpp.
|
inline |
Returns the log loss function for binary classification with specified reference and response values.
The log loss function for prediction \(\hat{y} \in [0, 1]\) given outcome \(y \in \{ 0, 1 \}\) is
\(\mbox{logloss}(1, \hat{y}) = -\log \hat{y} \), and
\(\mbox{logloss}(0, \hat{y}) = -\log (1 - \hat{y}) \).
| T | value type |
| [in] | y | reference value, either 0 or 1 |
| [in] | y_hat | response value in [0, 1] |
Definition at line 30 of file binary_log_loss.hpp.
The log loss function for variables (stan).
See binary_log_loss() for the double-based version.
The derivative with respect to the variable \(\hat{y}\) is
\(\frac{d}{d\hat{y}} \mbox{logloss}(1, \hat{y}) = - \frac{1}{\hat{y}}\), and
\(\frac{d}{d\hat{y}} \mbox{logloss}(0, \hat{y}) = \frac{1}{1 - \hat{y}}\).
\[ \mbox{binary\_log\_loss}(y, \hat{y}) = \begin{cases} y \log \hat{y} + (1 - y) \log (1 - \hat{y}) & \mbox{if } 0\leq \hat{y}\leq 1, y\in\{ 0, 1 \}\\[6pt] \textrm{NaN} & \mbox{if } \hat{y} = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{binary\_log\_loss}(y, \hat{y})}{\partial \hat{y}} = \begin{cases} \frac{y}{\hat{y}}-\frac{1-y}{1-\hat{y}} & \mbox{if } 0\leq \hat{y}\leq 1, y\in\{ 0, 1 \}\\[6pt] \textrm{NaN} & \mbox{if } \hat{y} = \textrm{NaN} \end{cases} \]
| y | Reference value. |
| y_hat | Response variable. |
Definition at line 46 of file binary_log_loss.hpp.
|
inline |
Enables the vectorised application of the binary log loss function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 47 of file binary_log_loss.hpp.
|
inline |
Overload with int and var_value<Matrix>
Definition at line 62 of file binary_log_loss.hpp.
|
inline |
Overload with var_value<Matrix> for std::vector<int> and std::vector<std::vector<int>>
Definition at line 82 of file binary_log_loss.hpp.
|
inline |
Return the log of the binomial coefficient for the specified arguments.
The binomial coefficient, \({n \choose k}\), read "n choose k", is defined for \(0 \leq k \leq n\) by
\({n \choose k} = \frac{n!}{k! (n-k)!}\).
This function uses Gamma functions to define the log and generalize the arguments to continuous n and k.
\( \log {n \choose k} = \log \ \Gamma(n+1) - \log \Gamma(k+1) - \log \Gamma(n-k+1)\).
\[ \mbox{binomial\_coefficient\_log}(x, y) = \begin{cases} \textrm{error} & \mbox{if } y > x + 1 \textrm{ or } y < -1 \textrm{ or } x < -1\\ \ln\Gamma(x+1) & \mbox{if } -1 < y < x + 1 \\ \quad -\ln\Gamma(y+1)& \\ \quad -\ln\Gamma(x-y+1)& \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{binomial\_coefficient\_log}(x, y)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } y > x + 1 \textrm{ or } y < -1 \textrm{ or } x < -1\\ \Psi(x+1) & \mbox{if } 0\leq y \leq x \\ \quad -\Psi(x-y+1)& \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{binomial\_coefficient\_log}(x, y)}{\partial y} = \begin{cases} \textrm{error} & \mbox{if } y > x + 1 \textrm{ or } y < -1 \textrm{ or } x < -1\\ -\Psi(y+1) & \mbox{if } 0\leq y \leq x \\ \quad +\Psi(x-y+1)& \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
This function is numerically more stable than naive evaluation via lgamma.
| T_n | type of the first argument |
| T_k | type of the second argument |
| n | total number of objects. |
| k | number of objects chosen. |
Definition at line 81 of file binomial_coefficient_log.hpp.
|
inline |
Enables the vectorised application of the binomial coefficient log function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 164 of file binomial_coefficient_log.hpp.
|
inline |
Definition at line 101 of file binomial_logit_lpmf.hpp.
|
inline |
Definition at line 140 of file binomial_lpmf.hpp.
|
inline |
Return a nrows x ncols submatrix starting at (i-1, j-1).
| T | type of elements in the matrix |
| m | Matrix. |
| i | Starting row. |
| j | Starting column. |
| nrows | Number of rows in block. |
| ncols | Number of columns in block. |
| std::out_of_range | if either index is out of range. |
|
inline |
Return a nrows x ncols submatrix starting at (i-1, j-1).
| T | type of elements in the matrix |
| x | Matrix. |
| i | Starting row. |
| j | Starting column. |
| nrows | Number of rows in block. |
| ncols | Number of columns in block. |
| std::out_of_range | if either index is out of range. |
|
inline |
Return a nrows x ncols submatrix starting at (i-1, j-1).
| T | type of elements in the matrix |
| m | Matrix. |
| i | Starting row. |
| j | Starting column. |
| nrows | Number of rows in block. |
| ncols | Number of columns in block. |
| std::out_of_range | if either index is out of range. |
Allocates and populates a flat array of vari pointers in the autodiff arena with the varis pointed to by the vars in the input Eigen matrix.
| R | number of rows, can be Eigen::Dynamic |
| C | number of columns, can be Eigen::Dynamic |
| x | input matrix |
Definition at line 21 of file build_vari_array.hpp.
| return_type_t<T_x, T_alpha, T_beta> stan::math::categorical_logit_glm_lpmf | ( | const T_y & | y, |
| const T_x & | x, | ||
| const T_alpha & | alpha, | ||
| const T_beta & | beta | ||
| ) |
Definition at line 196 of file categorical_logit_glm_lpmf.hpp.
| return_type_t<T_prob> stan::math::categorical_logit_lpmf | ( | int | n, |
| const T_prob & | beta | ||
| ) |
Definition at line 18 of file categorical_logit_lpmf.hpp.
| return_type_t<T_prob> stan::math::categorical_logit_lpmf | ( | const std::vector< int > & | ns, |
| const T_prob & | beta | ||
| ) |
Definition at line 36 of file categorical_logit_lpmf.hpp.
|
inline |
Definition at line 66 of file categorical_logit_lpmf.hpp.
| return_type_t<T_prob> stan::math::categorical_lpmf | ( | int | n, |
| const T_prob & | theta | ||
| ) |
Definition at line 17 of file categorical_lpmf.hpp.
| return_type_t<T_prob> stan::math::categorical_lpmf | ( | const std::vector< int > & | ns, |
| const T_prob & | theta | ||
| ) |
Definition at line 33 of file categorical_lpmf.hpp.
|
inline |
Definition at line 62 of file categorical_lpmf.hpp.
|
inline |
Definition at line 14 of file categorical_rng.hpp.
|
inline |
Definition at line 120 of file cauchy_lpdf.hpp.
Returns the cube root of the specified variable (C99).
The derivative is
\(\frac{d}{dx} x^{1/3} = \frac{1}{3 x^{2/3}}\).
\[ \mbox{cbrt}(x) = \begin{cases} \sqrt[3]{x} & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{cbrt}(x)}{\partial x} = \begin{cases} \frac{1}{3x^{2/3}} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Specified variable. |
|
inline |
|
inline |
|
inline |
Returns the elementwise ceil() of the input, which may be a scalar or any Stan container of numeric scalars.
Version of ceil() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these.
| Container | type of container |
| x | container |
| Container | Type of x |
| x | Container |
Return the ceiling of the specified variable (cmath).
The derivative of the ceiling function is defined and zero everywhere but at integers, and we set them to zero for convenience,
\(\frac{d}{dx} {\lceil x \rceil} = 0\).
The ceiling function rounds up. For double values, this is the smallest integral value that is not less than the specified value. Although this function is not differentiable because it is discontinuous at integral values, its gradient is returned as zero everywhere.
\[ \mbox{ceil}(x) = \begin{cases} \lceil x\rceil & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{ceil}(x)}{\partial x} = \begin{cases} 0 & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Input variable. |
|
inline |
|
inline |
Check if the hypergeometric function (2F1) called with supplied arguments will converge, assuming arguments are finite values.
| T_a1 | Type of a1 |
| T_a2 | Type of a2 |
| T_b1 | Type of b1 |
| T_z | Type of z |
| function | Name of function ultimately relying on 2F1 (for error messages) |
| a1 | Variable to check |
| a2 | Variable to check |
| b1 | Variable to check |
| z | Variable to check |
| <code>domain_error</code> | if 2F1(a1, a2, b1, z) does not meet convergence conditions, or if any coefficient is NaN. |
Definition at line 35 of file check_2F1_converges.hpp.
|
inline |
Check if the hypergeometric function (3F2) called with supplied arguments will converge, assuming arguments are finite values.
| T_a1 | Type of a1 |
| T_a2 | Type of a2 |
| T_a3 | Type of a3 |
| T_b1 | Type of b1 |
| T_b2 | Type of b2 |
| T_z | Type of z |
| function | Name of function ultimately relying on 3F2 (for error & messages) |
| a1 | Variable to check |
| a2 | Variable to check |
| a3 | Variable to check |
| b1 | Variable to check |
| b2 | Variable to check |
| z | Variable to check |
| <code>domain_error</code> | if 3F2(a1, a2, a3, b1, b2, z) does not meet convergence conditions, or if any coefficient is NaN. |
Definition at line 40 of file check_3F2_converges.hpp.
|
inline |
Check if the value is between the low and high values, inclusively.
| T_y | Type of value |
| T_low | Type of low value |
| T_high | Type of high value |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Value to check |
| low | Low bound |
| high | High bound |
| <code>std::domain_error</code> | otherwise. This also throws if any of the arguments are NaN. |
Definition at line 75 of file check_bounded.hpp.
|
inline |
Throw an exception if the specified matrix is not a valid Cholesky factor.
A Cholesky factor is a lower triangular matrix whose diagonal elements are all positive. Note that Cholesky factors need not be square, but require at least as many rows M as columns N (i.e., M >= N).
| Mat | Type inheriting from MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1 |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Matrix to test |
| <tt>std::domain_error</tt> | if y is not a valid Cholesky factor, if number of rows is less than the number of columns, if there are 0 columns, or if any element in matrix is NaN |
Definition at line 33 of file check_cholesky_factor.hpp.
| void stan::math::check_cholesky_factor | ( | const char * | function, |
| const char * | name, | ||
| const StdVec & | y | ||
| ) |
Throw an exception if the specified matrix is not a valid Cholesky factor.
A Cholesky factor is a lower triangular matrix whose diagonal elements are all positive. Note that Cholesky factors need not be square, but require at least as many rows M as columns N (i.e., M >= N).
| StdVec | A standard vector with inner type either inheriting from MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1 |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Standard vector of matrices to test |
| <tt>std::domain_error</tt> | if y is not a valid Cholesky factor, if number of rows is less than the number of columns, if there are 0 columns, or if any element in matrix is NaN |
Definition at line 61 of file check_cholesky_factor.hpp.
| void stan::math::check_cholesky_factor_corr | ( | const char * | function, |
| const char * | name, | ||
| const Mat & | y | ||
| ) |
Throw an exception if the specified matrix is not a valid Cholesky factor of a correlation matrix.
A Cholesky factor is a lower triangular matrix whose diagonal elements are all positive and each row has unit Euclidean length. Note that Cholesky factors need not be square, but require at least as many rows M as columns N (i.e., M >= N). Tolerance is specified by math::CONSTRAINT_TOLERANCE. Tolerance is specified by math::CONSTRAINT_TOLERANCE.
| Mat | Type inheriting from MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1 |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Matrix to test |
| <tt>std::domain_error</tt> | if y is not a valid Cholesky factor, if number of rows is less than the number of columns, if there are 0 columns, or if any element in matrix is NaN |
Definition at line 37 of file check_cholesky_factor_corr.hpp.
| void stan::math::check_cholesky_factor_corr | ( | const char * | function, |
| const char * | name, | ||
| const StdVec & | y | ||
| ) |
Throw an exception if the specified matrix is not a valid Cholesky factor of a correlation matrix.
A Cholesky factor is a lower triangular matrix whose diagonal elements are all positive and each row has unit Euclidean length. Note that Cholesky factors need not be square, but require at least as many rows M as columns N (i.e., M >= N). Tolerance is specified by math::CONSTRAINT_TOLERANCE. Tolerance is specified by math::CONSTRAINT_TOLERANCE.
| StdVec | A standard vector with inner type either inheriting from MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1 |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Standard vector of matrics to test |
| <tt>std::domain_error</tt> | if y[i] is not a valid Cholesky factor, if number of rows is less than the number of columns, if there are 0 columns, or if any element in matrix is NaN |
Definition at line 69 of file check_cholesky_factor_corr.hpp.
|
inline |
Check if the specified index is a valid column of the matrix.
By default this is a 1-indexed check (as opposed to 0-indexed). Behavior can be changed by setting stan::error_index::value. This function will throw an std::out_of_range exception if the index is out of bounds.
| T_y | Type of matrix |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | matrix to test |
| i | column index to check |
| <code>std::out_of_range</code> | if index is an invalid column |
Definition at line 30 of file check_column_index.hpp.
|
inline |
Check if x is consistent with size expected_size.
x is consistent with size expected_size if x is a vector of size expected_size, or a non vector.
| T | type of value |
| function | function name (for error messages) |
| name | variable name (for error messages) |
| x | variable to check for consistent size |
| expected_size | expected size if x is a vector |
| <tt>invalid_argument</tt> | if the size is inconsistent |
Definition at line 25 of file check_consistent_size.hpp.
|
inline |
Trivial no input case, this function is a no-op.
Definition at line 15 of file check_consistent_sizes.hpp.
|
inline |
Base case of recursion, this function is a no-op.
| T1 | type of first input |
Definition at line 22 of file check_consistent_sizes.hpp.
|
inline |
Check that the inputs are of consistent size.
Two inputs are of consistent size if they are vectors of the same size, or if at least one is not a vector.
E.g.: check_consistent_sizes("some_function", "x1", x1, "x2", x2, etc.).
| T1 | type of first input |
| T2 | type of second input |
| Ts | type of other inputs |
| function | function name (for error messages) |
| name1 | name of variable corresponding to first input |
| x1 | first input |
| name2 | name of variable corresponding to second input |
| x2 | second input |
| names_and_xs | more inputs |
| <tt>invalid_argument</tt> | if sizes are inconsistent |
Definition at line 46 of file check_consistent_sizes.hpp.
|
inline |
Trivial no input case, this function is a no-op.
Definition at line 15 of file check_consistent_sizes_mvt.hpp.
|
inline |
Base case of recursion, this function is a no-op.
| T1 | type of first input |
Definition at line 22 of file check_consistent_sizes_mvt.hpp.
|
inline |
Check that the provided multivariate inputs are of consistent size with each other.
Two multivariate inputs are of consistent size if both are std::vectors of the same size, or if at least one is a not an std::vector.
E.g.: check_consistent_sizes_mvt("some_function", "x1", x1, "x2", x2, etc.).
| T1 | type of first input |
| T2 | type of second input |
| Ts | type of other inputs |
| function | function name (for error messages) |
| name1 | name of variable corresponding to first input |
| x1 | first input |
| name2 | name of variable corresponding to second input |
| x2 | second input |
| names_and_xs | more inputs |
| <tt>invalid_argument</tt> | if sizes are inconsistent |
Definition at line 46 of file check_consistent_sizes_mvt.hpp.
|
inline |
Throw an exception if the specified matrix is not a valid correlation matrix.
A valid correlation matrix is symmetric positive definite, has a unit diagonal (all 1 values), and has all values between -1 and 1 (inclusive).
| Mat | Type inheriting from MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1 |
| function | Name of the function this was called from |
| name | Name of the variable |
| y | Matrix to test |
| <tt>std::invalid_argument</tt> | if the matrix is not square |
| <tt>std::domain_error</tt> | if the matrix is non-symmetric, diagonals not near 1, not positive definite, or any of the elements are NaN |
Definition at line 34 of file check_corr_matrix.hpp.
| void stan::math::check_corr_matrix | ( | const char * | function, |
| const char * | name, | ||
| const StdVec & | y | ||
| ) |
Throw an exception if the specified matrix is not a valid correlation matrix.
A valid correlation matrix is symmetric positive definite, has a unit diagonal (all 1 values), and has all values between -1 and 1 (inclusive).
| StdVec | A standard vector with inner type either inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1. |
| function | Name of the function this was called from |
| name | Name of the variable |
| y | Matrix to test |
| <tt>std::invalid_argument</tt> | if the matrix is not square |
| <tt>std::domain_error</tt> | if the matrix is non-symmetric, diagonals not near 1, not positive definite, or any of the elements are NaN |
Definition at line 76 of file check_corr_matrix.hpp.
|
inline |
Throw an exception if the specified matrix is not a valid covariance matrix.
A valid covariance matrix is a square, symmetric matrix that is positive definite.
| Mat | Type inheriting from MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1 |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Matrix to test |
| <tt>std::invalid_argument</tt> | if the matrix is not square or if the matrix is 0x0 |
| <tt>std::domain_error</tt> | if the matrix is not symmetric, if the matrix is not positive definite, or if any element of the matrix is NaN |
Definition at line 29 of file check_cov_matrix.hpp.
| void stan::math::check_cov_matrix | ( | const char * | function, |
| const char * | name, | ||
| const StdVec & | y | ||
| ) |
Throw an exception if the specified matrix is not a valid covariance matrix.
A valid covariance matrix is a square, symmetric matrix that is positive definite.
| StdVec | A standard vector with inner type either inheriting from MatrixBase with neither rows or columns defined at compile time to be equal to 1 or a var_value with the var's inner type inheriting from Eigen::MatrixBase with neither rows or columns defined at compile time to be equal to 1 |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | standard vector of matrices to test. |
| <tt>std::invalid_argument</tt> | if the matrix is not square or if the matrix is 0x0 |
| <tt>std::domain_error</tt> | if the matrix is not symmetric, if the matrix is not positive definite, or if any element of the matrix is NaN |
Definition at line 52 of file check_cov_matrix.hpp.
|
inline |
Return true if all values in y are finite.
y can be a scalar, std::vector or Eigen type.
| T_y | type of y |
| function | name of function (for error messages) |
| name | variable name (for error messages) |
| y | scalar or container to test |
true if all values are finite Definition at line 28 of file check_finite.hpp.
|
inline |
Throws an exception message when the function KINSol() (call to the solver) fails.
When the exception is caused by a tuning parameter the user controls, gives a specific error.
| flag | Error flag |
| max_num_steps | Maximum number of iterations the algebra solver should take before throwing an error |
| <code>std::domain_error</code> | if flag means maximum number of iterations exceeded in the algebra solver. |
| <code>std::runtime_error</code> | if the flag is negative for any other reason. |
Definition at line 40 of file check_flag_sundials.hpp.
|
inline |
Throws a std::runtime_error exception when a Sundial function fails (i.e.
returns a negative flag)
| flag | Error flag |
| func_name | Name of the function that returned the flag |
| <code>std::runtime_error</code> | if the flag is negative |
Definition at line 18 of file check_flag_sundials.hpp.
|
inline |
Throw an exception if y is not strictly greater than low.
Throw an exception if each element of y is not strictly greater than the associated element in low.
This function is vectorized and will check each element of y against each element of low.
| Idxs | A parameter pack of Integral types |
| T_y | A scalar type type |
| T_low | A scalar type |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| Idxs | A parameter pack of Integral types |
| T_y | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| T_low | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
Definition at line 36 of file check_greater.hpp.
|
inline |
Throw an exception if y is not strictly greater than each element of low.
Throw an exception if each element of y is not strictly greater than low.
This function is vectorized and will check each element of y against each element of low.
| Idxs | A parameter pack of Integral types |
| T_y | A scalar type |
| T_low | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| Idxs | A parameter pack of Integral types |
| T_y | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar |
| T_low | A scalar type |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
Definition at line 72 of file check_greater.hpp.
|
inline |
Throw an exception if y is not strictly greater than each element of low.
Throw an exception if each element of y is not strictly greater than the associated element in low.
Throw an exception if each element of y is not strictly greater than low.
This function is vectorized and will check each element of y against each element of low.
| Idxs | A parameter pack of Integral types |
| T_y | A scalar type |
| T_low | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| Idxs | A parameter pack of Integral types |
| T_y | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| T_low | A scalar type |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| Idxs | A parameter pack of Integral types |
| T_y | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| T_low | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| Idxs | A parameter pack of Integral types |
| T_y | A standard vector type with a value_type of a standard vector or type inheriting from Eigen::DenseBase |
| T_low | A scalar type or the same type as the underlying type in T_y |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| Idxs | A parameter pack of Integral types |
| T_y | A scalar type or the same type as the inner type of T_low |
| T_low | A standard vector type with a value_type of a standard vector or type inheriting from Eigen::DenseBase |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| Idxs | A parameter pack of Integral types |
| T_y | A standard vector type whose value_type is a scalar, type inheriting from Eigen::EigenBase, or another standard vector |
| T_low | A standard vector type whose value_type is a scalar, type inheriting from Eigen::EigenBase, or another standard vector |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
Definition at line 108 of file check_greater.hpp.
|
inline |
Throw an exception if y is not greater or equal than low.
Throw an exception if each element of y is not greater or equal than the associated element in low.
This function is vectorized and will check each element of y against each element of low.
| T_y | A scalar type |
| T_low | A scalar type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| T_y | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| T_low | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
Definition at line 36 of file check_greater_or_equal.hpp.
|
inline |
Throw an exception if y is not greater or equal than each element of low.
Throw an exception if each element of y is not greater or equal than low.
This function is vectorized and will check each element of y against each element of low.
| T_y | A scalar type |
| T_low | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| T_y | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar |
| T_low | A scalar type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
Definition at line 74 of file check_greater_or_equal.hpp.
|
inline |
Throw an exception if y is not greater or equal than each element of low.
Throw an exception if each element of y is not greater or equal than the associated element in low.
Throw an exception if each element of y is not greater or equal than low.
This function is vectorized and will check each element of y against each element of low.
| T_y | A scalar type |
| T_low | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| T_y | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| T_low | A scalar type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| T_y | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar |
| T_low | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| T_y | A standard vector type with a value_type of a standard vector or type inheriting from Eigen::DenseBase |
| T_low | A standard vector type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| T_y | A standard vector |
| T_low | A standard vector type with a value_type of a standard |
| Idxs | A parameter pack of Integral types vector or type inheriting from Eigen::DenseBase |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
This function is vectorized and will check each element of y against each element of low.
| T_y | A standard vector type |
| T_low | A standard vector type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| low | Lower bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not greater or equal to low or if any element of y or low is NaN |
Definition at line 112 of file check_greater_or_equal.hpp.
|
inline |
Raise domain error if the specified LDLT factor is invalid.
An LDLT_factor is invalid if it was constructed from a matrix that is not positive definite.
| T | Type matrix of LDLT |
| [in] | function | name of function for error messages |
| [in] | name | variable name for error messages |
| [in] | A | the LDLT factor to check for validity |
| <code>std::domain_error</code> | if the LDLT factor is invalid |
Definition at line 25 of file check_ldlt_factor.hpp.
|
inline |
Throw an exception if y is not strictly less than high.
Throw an exception if each element of y is not strictly less than each element of high.
This function is vectorized and will check each element of y against each element of high.
| T_y | A scalar type |
| T_high | A scalar type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| T_high | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
Definition at line 35 of file check_less.hpp.
|
inline |
Throw an exception if y is not strictly less than each element of high.
Throw an exception if each element of y is not strictly less than high.
This function is vectorized and will check each element of y against each element of high.
| T_y | A scalar type |
| T_high | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| T_high | A scalar type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
Definition at line 71 of file check_less.hpp.
|
inline |
Throw an exception if y is not strictly less than each element of high.
Throw an exception if each element of y is not strictly less than each associated element of high.
Throw an exception if each element of y is not strictly less than each element of high.
Throw an exception if each element of y is not strictly less than high.
This function is vectorized and will check each element of y against each element of high.
| T_y | A scalar type |
| T_high | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| T_high | A scalar type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| T_high | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | A standard vector type with a value_type of a standard vector or type inheriting from Eigen::DenseBase |
| T_high | A scalar type or the same type as the inner type of T_high |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | A scalar type or the same type as the inner type of T_high |
| T_high | A standard vector type with a value_type of a standard vector or type inheriting from Eigen::DenseBase |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | A standard vector type whose value_type is a scalar, type inheriting from Eigen::DenseBase, or another standard vector |
| T_high | A standard vector type whose value_type is a scalar, type inheriting from Eigen::DenseBase, or another standard vector |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
Definition at line 107 of file check_less.hpp.
|
inline |
Throw an exception if y is not less than high.
Throw an exception if each element of y is not less than the associated element of high.
This function is vectorized and will check each element of y against each element of high.
| T_y | A scalar type |
| T_high | A scalar type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| T_high | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
Definition at line 36 of file check_less_or_equal.hpp.
|
inline |
Throw an exception if y is not less than each element of high.
Throw an exception if each element of y is not less than high.
This function is vectorized and will check each element of y against each element of high.
| T_y | A scalar type |
| T_high | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| T_high | A scalar type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
Definition at line 74 of file check_less_or_equal.hpp.
|
inline |
Throw an exception if y is not less than each element of high.
Throw an exception if each element of y is not less than each associated element of high.
Throw an exception if each element of y is not less than the associated element of high.
Throw an exception if each element of y is not less than high.
This function is vectorized and will check each element of y against each element of high.
| T_y | A scalar type |
| T_high | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | Type inheriting from Eigen::DenseBase or a var_value with the var's inner type inheriting from Eigen::DenseBase where the compile time number of rows or columns is not equal to one |
| T_high | A scalar type |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| T_high | A standard vector or type inheriting from Eigen::DenseBase with compile time rows or columns equal to one and value_type equal to a stan scalar. |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | A standard vector type with a value_type of a standard vector or type inheriting from Eigen::DenseBase |
| T_high | A scalar or the same value_type of T_y |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | A scalar type or the same value_type of T_high |
| T_high | A standard vector type with a value_type of a standard vector or type inheriting from Eigen::DenseBase |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
This function is vectorized and will check each element of y against each element of high.
| T_y | A standard vector type whose value_type is a scalar, type inheriting from Eigen::EigenBase, or another standard vector |
| T_high | A standard vector type whose value_type is a scalar, type inheriting from Eigen::EigenBase, or another standard vector |
| Idxs | A parameter pack of Integral types |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| high | Upper bound |
| idxs | Pack of integral types to construct lazily construct the error message indices |
| <tt>std::domain_error</tt> | if y is not less than high or if any element of y or high is NaN |
Definition at line 112 of file check_less_or_equal.hpp.
|
inline |
Check if the specified matrix is lower triangular.
A matrix x is not lower triangular if there is a non-zero entry x[m, n] with m < n. This function only inspects the upper triangular portion of the matrix, not including the diagonal.
| T | Type of the matrix |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Matrix to test |
| <code>std::domain_error</code> | if the matrix is not lower triangular or if any element in the upper triangular portion is NaN |
Definition at line 27 of file check_lower_triangular.hpp.
|
inline |
Check if the two containers have the same dimensions.
Check if two matrices have the same row and column dimensions.
| T1 | type of the first container |
| T2 | type of the second container |
| function | name of function (for error messages) |
| name1 | variable name for the first container (for error messages) |
| y1 | first container to test |
| name2 | variable name for the second container (for error messages) |
| y2 | second container to test |
| <code>std::invalid_argument</code> | if the dimensions of the containers do not match |
| T1 | Either an Eigen type or a var_value with underlying Eigen type. |
| T2 | Either an Eigen type or a var_value with underlying Eigen type. |
| function | name of function (for error messages) |
| name1 | variable name for the first container (for error messages) |
| y1 | first matrix to test |
| name2 | variable name for the second container (for error messages) |
| y2 | second matrix to test |
| <code>std::invalid_argument</code> | if the dimensions of the containers do not match |
| T1 | Either an Eigen type, a var_value with underlying Eigen type, or scalar. |
| T2 | Either an Eigen type, a var_value with underlying Eigen type, or scalar. |
| function | name of function (for error messages) |
| name1 | variable name for the first container (for error messages) |
| y1 | first argument to test |
| name2 | variable name for the second container (for error messages) |
| y2 | second argument to test |
| <code>std::invalid_argument</code> | if the dimensions of the containers do not match |
Definition at line 29 of file check_matching_dims.hpp.
|
inline |
Check if the two matrices are of the same size.
This function checks the runtime sizes and can also check the static sizes as well. For example, a 4x1 matrix is not the same as a vector with 4 elements.
| check_compile | Whether to check the static sizes |
| Mat1 | type of the first matrix |
| Mat2 | type of the second matrix |
| function | name of function (for error messages) |
| name1 | variable name for the first matrix (for error messages) |
| y1 | first matrix to test |
| name2 | variable name for the second matrix (for error messages) |
| y2 | second matrix to test |
| <code>std::invalid_argument</code> | if the dimensions of the matrices do not match |
Definition at line 138 of file check_matching_dims.hpp.
|
inline |
Check if two structures at the same size.
This function only checks the runtime sizes for variables that implement a size() method.
| T_y1 | Type of the first variable |
| T_y2 | Type of the second variable |
| function | Function name (for error messages) |
| name1 | First variable name (for error messages) |
| y1 | First variable |
| name2 | Second variable name (for error messages) |
| y2 | Second variable |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 24 of file check_matching_sizes.hpp.
|
inline |
Check if the matrices can be multiplied.
This checks the runtime sizes to determine whether the two matrices are multiplicable. This allows Eigen matrices, vectors, and row vectors to be checked.
| T1 | Type of first matrix |
| T2 | Type of second matrix |
| function | Function name (for error messages) |
| name1 | Variable name for the first matrix (for error messages) |
| y1 | First matrix to test, requires class access to .rows() and .cols() |
| name2 | Variable name for the second matrix (for error messages) |
| y2 | Second matrix to test, requires class access to .rows() and .cols() |
| <code>std::invalid_argument</code> | if the matrices are not multiplicable or if either matrix is size 0 for either rows or columns |
Definition at line 30 of file check_multiplicable.hpp.
|
inline |
Check if y is non-negative.
This function is vectorized and will check each element of y.
| T_y | Type of y |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| <code>domain_error</code> | if y is negative or if any element of y is NaN. |
Definition at line 24 of file check_nonnegative.hpp.
|
inline |
Check if the specified matrix/vector is of non-zero size.
Throws a std:invalid_argument otherwise. The message will indicate that the variable name "has size 0".
| T_y | Type of container |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Container to test. This will accept matrices and vectors |
| <code>std::invalid_argument</code> | if the specified matrix/vector has zero size |
Definition at line 22 of file check_nonzero_size.hpp.
|
inline |
Check if y is not NaN.
This function is vectorized and will check each element of y. If any element is NaN, this function will throw an exception.
| T_y | Type of y |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| <code>domain_error</code> | if any element of y is NaN |
Definition at line 26 of file check_not_nan.hpp.
| void stan::math::check_ordered | ( | const char * | function, |
| const char * | name, | ||
| const T_y & | y | ||
| ) |
Throw an exception if the specified vector is not sorted into strictly increasing order.
Throw an exception if each vector in a standard vector is not sorted into strictly increasing order.
| T_y | A type inheriting from EigenBase with either 1 compile time row or column |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Vector to test |
| <tt>std::domain_error</tt> | if the vector elements are not ordered, if there are duplicated values, or if any element is NaN |
| T_y | A standard vector with an inner vector type |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | std::vector to test |
| <tt>std::domain_error</tt> | if the vector elements are not ordered, if there are duplicated values, or if any element is NaN |
Definition at line 30 of file check_ordered.hpp.
| void stan::math::check_ordered | ( | const char * | function, |
| const char * | name, | ||
| const T_y & | y | ||
| ) |
Throw an exception if the specified vector is not sorted into strictly increasing order.
| T_y | A standard vector with inner scalar type |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | std::vector to test |
| <tt>std::domain_error</tt> | if the vector elements are not ordered, if there are duplicated values, or if any element is NaN |
Definition at line 61 of file check_ordered.hpp.
|
inline |
Check if the specified square, symmetric matrix is positive definite.
This computes an LDLT decomposition to establish positive definiteness, so it can be expensive. If an LDLT or LLT decomposition is available, that should be tested instead.
| EigMat | A type derived from EigenBase with dynamic rows and columns |
| function | function name (for error messages) |
| name | variable name (for error messages) |
| y | matrix to test |
| std::invalid_argument | if the matrix is not square or if the matrix has 0 size. |
| std::domain_error | if the matrix is not symmetric, if it is not positive definite, or if any element is NaN |
Definition at line 34 of file check_pos_definite.hpp.
|
inline |
Check if the specified LDLT decomposition of a matrix is positive definite.
| Derived | type of the Eigen::LDLT decomposition |
| function | function name (for error messages) |
| name | variable name (for error messages) |
| cholesky | Eigen::LDLT to test, whose progenitor must not have any NaN elements |
| std::domain_error | if the matrix is not positive definite |
Definition at line 63 of file check_pos_definite.hpp.
|
inline |
Check if the specified LLT decomposition was successful.
| Derived | type of the Eigen::LLT decomposition |
| function | function name (for error messages) |
| name | variable name (for error messages) |
| cholesky | Eigen::LLT to test, whose progenitor must not have any NaN elements |
| std::domain_error | if the decomposition failed or the diagonal of the L matrix is not positive |
Definition at line 83 of file check_pos_definite.hpp.
|
inline |
Check if the specified matrix is positive definite.
| EigMat | A type derived from EigenBase with dynamic rows and columns |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Matrix to test |
| <code>std::invalid_argument</code> | if the matrix is not square or if the matrix has 0 size. |
| <code>std::domain_error</code> | if the matrix is not symmetric, or if it is not positive semi-definite, or if any element of the matrix is NaN. |
Definition at line 30 of file check_pos_semidefinite.hpp.
|
inline |
Check if the specified matrix is positive semidefinite.
| Derived | Derived type of the Eigen::LDLT transform. |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| cholesky | Eigen::LDLT to test |
| <code>std::domain_error</code> | if the matrix is not positive semi-definite. |
Definition at line 62 of file check_pos_semidefinite.hpp.
|
inline |
Check if y is positive.
This function is vectorized and will check each element of y.
| T_y | Type of y |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| <code>domain_error</code> | if y is negative or zero or if any element of y is NaN |
Definition at line 27 of file check_positive.hpp.
|
inline |
Check if size is positive.
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| expr | Expression for the dimension size (for error messages) |
| size | Size value to check |
| <code>std::invalid_argument</code> | if size is zero or negative. |
Definition at line 42 of file check_positive.hpp.
|
inline |
Check if y is positive and finite.
This function is vectorized and will check each element of y.
| T_y | Type of y |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Variable to check |
| <code>domain_error</code> | if any element of y is not positive or if any element of y is NaN. |
Definition at line 22 of file check_positive_finite.hpp.
| void stan::math::check_positive_ordered | ( | const char * | function, |
| const char * | name, | ||
| const Vec & | y | ||
| ) |
Throw an exception if the specified the vector contains negative values or is not sorted into strictly increasing order.
| Vec | A type derived from Eigen::EigenBase with 1 compile time row or column |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Vector to test |
| <tt>std::domain_error</tt> | if the vector contains non-positive values, if the values are not ordered, if there are duplicated values, or if any element is NaN |
Definition at line 31 of file check_positive_ordered.hpp.
| void stan::math::check_positive_ordered | ( | const char * | function, |
| const char * | name, | ||
| const StdVec & | y | ||
| ) |
Throw an exception if any of the vectors in a standard vector contains negative values or is not sorted into strictly increasing order.
| StdVec | A standard vector type with an value_type inheriting from Eigen::EigenBase with 1 compile time row or column |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Vector to test |
| <tt>std::domain_error</tt> | if the vector contains non-positive values, if the values are not ordered, if there are duplicated values, or if any element is NaN |
Definition at line 63 of file check_positive_ordered.hpp.
|
inline |
Check if specified index is within range.
This check is 1-indexed by default. This behavior can be changed by setting stan::error_index::value.
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| max | Maximum size of the variable |
| index | Index to check |
| nested_level | Nested level (for error messages) |
| error_msg | Additional error message (for error messages) |
| <code>std::out_of_range</code> | if the index is not in range |
Definition at line 24 of file check_range.hpp.
|
inline |
Check if specified index is within range.
This check is 1-indexed by default. This behavior can be changed by setting stan::error_index::value.
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| max | Maximum size of the variable |
| index | Index to check |
| error_msg | Additional error message (for error messages) |
| <code>std::out_of_range</code> | if the index is not in range |
Definition at line 49 of file check_range.hpp.
|
inline |
Check if specified index is within range.
This check is 1-indexed by default. This behavior can be changed by setting stan::error_index::value.
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| max | Maximum size of the variable |
| index | Index to check |
| <code>std::out_of_range</code> | if the index is not in range |
Definition at line 68 of file check_range.hpp.
|
inline |
Check if the specified index is a valid row of the matrix This check is 1-indexed by default.
This behavior can be changed by setting stan::error_index::value.
| T | Matrix type |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | matrix to test |
| i | row index to check |
| <code>std::out_of_range</code> | if the index is out of range. |
Definition at line 25 of file check_row_index.hpp.
| void stan::math::check_simplex | ( | const char * | function, |
| const char * | name, | ||
| const T & | theta | ||
| ) |
Throw an exception if the specified vector is not a simplex.
Throw an exception if each vector in a standard vector is not a simplex.
To be a simplex, all values must be greater than or equal to 0 and the values must sum to 1. A valid simplex is one where the sum of the elements is equal to 1. This function tests that the sum is within the tolerance specified by CONSTRAINT_TOLERANCE. This function only accepts Eigen vectors, statically typed vectors, not general matrices with 1 column.
| T | A type inheriting from Eigen::EigenBase |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| theta | Vector to test |
| <tt>std::invalid_argument</tt> | if theta is a 0-vector |
| <tt>std::domain_error</tt> | if the vector is not a simplex or if any element is NaN |
To be a simplex, all values must be greater than or equal to 0 and the values must sum to 1. A valid simplex is one where the sum of the elements is equal to 1. This function tests that the sum is within the tolerance specified by CONSTRAINT_TOLERANCE. This function only accepts Eigen vectors, statically typed vectors, not general matrices with 1 column.
| T | A standard vector with inner type inheriting from Eigen::EigenBase |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| theta | Vector to test. |
| <tt>std::invalid_argument</tt> | if theta is a 0-vector |
| <tt>std::domain_error</tt> | if the vector is not a simplex or if any element is NaN |
Definition at line 34 of file check_simplex.hpp.
|
inline |
Check if the provided sizes match.
| T_size1 | Type of size 1 |
| T_size2 | Type of size 2 |
| function | Function name (for error messages) |
| name_i | Variable name 1 (for error messages) |
| i | Variable size 1 |
| name_j | Variable name 2 (for error messages) |
| j | Variable size 2 |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 24 of file check_size_match.hpp.
|
inline |
Check if the provided sizes match.
| T_size1 | Type of size 1 |
| T_size2 | Type of size 2 |
| function | Function name (for error messages) |
| expr_i | Expression for variable name 1 (for error messages) |
| name_i | Variable name 1 (for error messages) |
| i | Variable size 1 |
| expr_j | Expression for variable name 2 (for error messages) |
| name_j | Variable name 2 (for error messages) |
| j | Variable size 2 |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 50 of file check_size_match.hpp.
| void stan::math::check_sorted | ( | const char * | function, |
| const char * | name, | ||
| const EigVec & | y | ||
| ) |
Check if the specified vector is sorted into increasing order (repeated values are okay).
| EigVec | A type derived from EigenBase with 1 compile time row or column. |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Vector to test |
| <code>std::domain_error</code> | if the vector elements are not sorted, or if any element is NaN. |
Definition at line 26 of file check_sorted.hpp.
| void stan::math::check_sorted | ( | const char * | function, |
| const char * | name, | ||
| const std::vector< T_y > & | y | ||
| ) |
Check if the specified vector is sorted into increasing order (repeated values are okay).
| T_y | Type of scalar |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | std::vector to test |
| <code>std::domain_error</code> | if the vector elements are not sorted, or if any element is NaN. |
Definition at line 56 of file check_sorted.hpp.
|
inline |
Check if the specified matrix is square.
This check allows 0x0 matrices.
| T | Type of matrix |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Matrix to test |
| <code>std::invalid_argument</code> | if the matrix is not square |
Definition at line 23 of file check_square.hpp.
|
inline |
Check if the specified index is valid in std vector This check is 1-indexed by default.
This behavior can be changed by setting stan::error_index::value.
| T | Scalar type |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | std::vector to test |
| i | Index |
| <code>std::out_of_range</code> | if the index is out of range. |
Definition at line 26 of file check_std_vector_index.hpp.
|
inline |
Check if the specified matrix is symmetric.
The error message is either 0 or 1 indexed, specified by stan::error_index::value.
| EigMat | Type of matrix |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | Matrix to test |
| <code>std::invalid_argument</code> | if the matrix is not square. |
| <code>std::domain_error</code> | if any element not on the main diagonal is NaN |
Definition at line 32 of file check_symmetric.hpp.
| void stan::math::check_unit_vector | ( | const char * | function, |
| const char * | name, | ||
| const Vec & | theta | ||
| ) |
Throw an exception if the specified vector does not have unit Euclidiean length.
A valid unit vector is one where the square of the elements summed is equal to 1. This function tests that the sum is within the tolerance specified by CONSTRAINT_TOLERANCE. This function only accepts Eigen vectors, statically typed vectors, not general matrices with 1 column.
| Vec | A type derived from Eigen::EigenBase with either dynamic rows or columns but not both |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| theta | Vector to test |
| <tt>std::invalid_argument</tt> | if theta is a 0-vector |
| <tt>std::domain_error</tt> | if the vector is not a unit vector or if any element is NaN |
Definition at line 37 of file check_unit_vector.hpp.
| void stan::math::check_unit_vector | ( | const char * | function, |
| const char * | name, | ||
| const StdVec & | theta | ||
| ) |
Throw an exception if the each element in a standard vector does not have unit Euclidiean length.
| StdVec | A standard vector with inner type inheriting from Eigen::EigenBase |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| theta | Vector to test |
| <tt>std::invalid_argument</tt> | if theta is a 0-vector |
| <tt>std::domain_error</tt> | if the vector is not a unit vector or if any element is NaN |
Definition at line 67 of file check_unit_vector.hpp.
|
inline |
Check the input is either a row vector or column vector or a matrix with a single row or column.
| Mat | Input type |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| x | Input |
| <code>std::invalid_argument</code> | if x is not a row or column vector. |
Definition at line 32 of file check_vector.hpp.
|
inline |
Check if the specified index is a valid element of the row or column vector This check is 1-indexed by default.
This behavior can be changed by setting stan::error_index::value.
| T | Vector type |
| function | Function name (for error messages) |
| name | Variable name (for error messages) |
| y | vector to test |
| i | row index to check |
| <code>std::out_of_range</code> | if the index is out of range. |
Definition at line 27 of file check_vector_index.hpp.
|
inline |
Definition at line 102 of file chi_square_lpdf.hpp.
| plain_type_t<T> stan::math::chol2inv | ( | const T & | L | ) |
Returns the inverse of the matrix whose Cholesky factor is L.
| T | type of elements in the matrix |
| L | Matrix that is a Cholesky factor. |
| std::domain_error | If the input matrix is not square or lower triangular |
Definition at line 24 of file chol2inv.hpp.
|
inline |
Definition at line 17 of file cholesky_corr_constrain.hpp.
| var_value<Eigen::MatrixXd> stan::math::cholesky_corr_constrain | ( | const T & | y, |
| int | K | ||
| ) |
Return the Cholesky factor of the correlation matrix of the sepcified size read from the unconstrained vector y.
A total of K choose 2 elements are required to build a K by K Cholesky factor.
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| y | Vector of unconstrained values |
| K | number of rows |
Definition at line 28 of file cholesky_corr_constrain.hpp.
|
inline |
Definition at line 48 of file cholesky_corr_constrain.hpp.
| var_value<Eigen::MatrixXd> stan::math::cholesky_corr_constrain | ( | const T & | y, |
| int | K, | ||
| scalar_type_t< T > & | lp | ||
| ) |
Return the Cholesky factor of the correlation matrix of the sepcified size read from the unconstrained vector y.
A total of K choose 2 elements are required to build a K by K Cholesky factor.
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| y | Vector of unconstrained values | |
| K | number of rows | |
| [out] | lp | Log density that is incremented with the log Jacobian |
Definition at line 92 of file cholesky_corr_constrain.hpp.
|
inline |
Return The cholesky of a KxK correlation matrix.
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| y | Linearly Serialized vector of size (K * (K - 1))/2 holding the column major order elements of the lower triangurlar | |
| K | The size of the matrix to return | |
| [in,out] | lp | log density accumulator |
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| y | Linearly Serialized vector of size (K * (K - 1))/2 holding the column major order elements of the lower triangurlar | |
| K | The size of the matrix to return | |
| [in,out] | lp | log density accumulator |
Definition at line 94 of file cholesky_corr_constrain.hpp.
| auto stan::math::cholesky_corr_free | ( | const T & | x | ) |
Overload of cholesky_corr_free() to untransform each matrix in a standard vector.
| T | A standard vector with with a value_type which inherits from Eigen::MatrixBase. |
| x | The standard vector to untransform. |
Definition at line 14 of file cholesky_corr_free.hpp.
Returns the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric matrix on the OpenCL device.
The return value \(L\) will be a lower-triangular matrix such that the original matrix \(A\) is given by
\(A = L \times L^T\).
| A | Input square matrix |
| std::domain_error | if m is not a symmetric matrix or if m is not positive definite (if m has more than 0 elements) |
Definition at line 25 of file cholesky_decompose.hpp.
|
inline |
Returns the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric reverse mode matrix on the OpenCL device.
The return value \(L\) will be a lower-triangular matrix such that the original matrix \(A\) is given by
\(A = L \times L^T\).
| A | Input square matrix |
| std::domain_error | if m is not a symmetric matrix or if m is not positive definite (if m has more than 0 elements) |
Definition at line 26 of file cholesky_decompose.hpp.
|
inline |
Return the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric matrix.
The return value \(L\) will be a lower-triangular matrix such that the original matrix \(A\) is given by
\(A = L \times L^EigMat\).
| EigMat | type of the matrix (must be derived from Eigen::MatrixBase) |
| m | Symmetric matrix. |
cholesky_decompose functions. One that works on doubles and another that works on all other types (this one). | std::domain_error | if m is not a symmetric matrix or if m is not positive definite (if m has more than 0 elements) |
Definition at line 33 of file cholesky_decompose.hpp.
|
inline |
Reverse mode specialization of cholesky decomposition.
Internally calls Eigen::LLT rather than using stan::math::cholesky_decompose in order to use an inplace decomposition.
Note chainable stack varis are created below in Matrix<var, -1, -1>
| A | Matrix |
Definition at line 135 of file cholesky_decompose.hpp.
|
inline |
Reverse mode specialization of Cholesky decomposition.
Internally calls Eigen::LLT rather than using stan::math::cholesky_decompose in order to use an inplace decomposition.
Note chainable stack varis are created below in Matrix<var, -1, -1>
| T | A var_value holding an inner eigen type. |
| A | A square positive definite matrix with no nan values. |
Definition at line 171 of file cholesky_decompose.hpp.
| var_value<Eigen::MatrixXd> stan::math::cholesky_factor_constrain | ( | const T & | x, |
| int | M, | ||
| int | N | ||
| ) |
Return the Cholesky factor of the specified size read from the specified vector.
A total of (N choose 2) + N + (M - N) * N elements are required to read an M by N Cholesky factor.
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| x | Vector of unconstrained values |
| M | number of rows |
| N | number of columns |
Definition at line 30 of file cholesky_factor_constrain.hpp.
|
inline |
Return the Cholesky factor of the specified size read from the specified vector.
A total of (N choose 2) + N + (M - N) * N elements are required to read an M by N Cholesky factor.
| T | type of the vector (must be derived from Eigen::MatrixBase and have one compile-time dimension equal to 1) |
| x | Vector of unconstrained values |
| M | number of rows |
| N | number of columns |
Definition at line 30 of file cholesky_factor_constrain.hpp.
|
inline |
Return the Cholesky factor of the specified size read from the specified vector and increment the specified log probability reference with the log absolute Jacobian determinant adjustment of the transform.
A total of (N choose 2) + N + N * (M - N) free parameters are required to read an M by N Cholesky factor.
| T | type of the vector (must be derived from Eigen::MatrixBase and have one compile-time dimension equal to 1) |
| x | Vector of unconstrained values |
| M | number of rows |
| N | number of columns |
| lp | Log probability that is incremented with the log absolute Jacobian determinant |
Definition at line 76 of file cholesky_factor_constrain.hpp.
| var_value<Eigen::MatrixXd> stan::math::cholesky_factor_constrain | ( | const T & | x, |
| int | M, | ||
| int | N, | ||
| scalar_type_t< T > & | lp | ||
| ) |
Return the Cholesky factor of the specified size read from the specified vector and increment the specified log probability reference with the log Jacobian adjustment of the transform.
A total of (N choose 2) + N + N * (M - N) free parameters are required to read an M by N Cholesky factor.
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| x | Vector of unconstrained values | |
| M | number of rows | |
| N | number of columns | |
| [out] | lp | Log density that is incremented with the log Jacobian |
Definition at line 89 of file cholesky_factor_constrain.hpp.
|
inline |
Return the Cholesky factor of the specified size read from the specified vector.
A total of (N choose 2) + N + N * (M - N) free parameters are required to read an M by N Cholesky factor. If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| x | Vector of unconstrained values | |
| M | number of rows | |
| N | number of columns | |
| [in,out] | lp | log density accumulator |
A total of (N choose 2) + N + N * (M - N) free parameters are required to read an M by N Cholesky factor. If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| x | Vector of unconstrained values | |
| M | number of rows | |
| N | number of columns | |
| [in,out] | lp | log density accumulator |
Definition at line 110 of file cholesky_factor_constrain.hpp.
| Eigen::Matrix<value_type_t<T>, Eigen::Dynamic, 1> stan::math::cholesky_factor_free | ( | const T & | y | ) |
Return the unconstrained vector of parameters corresponding to the specified Cholesky factor.
A Cholesky factor must be lower triangular and have positive diagonal elements.
| T | type of the Cholesky factor (must be derived from Eigen::MatrixBase) |
| y | Cholesky factor. |
| std::domain_error | If the matrix is not a Cholesky factor. |
Definition at line 26 of file cholesky_factor_free.hpp.
| auto stan::math::cholesky_factor_free | ( | const T & | x | ) |
Overload of cholesky_factor_free() to untransform each matrix in a standard vector.
| T | A standard vector with with a value_type which inherits from Eigen::MatrixBase. |
| x | The standard vector to untransform. |
Definition at line 59 of file cholesky_factor_free.hpp.
|
inline |
Return the binomial coefficient for the specified integer arguments.
The binomial coefficient, \({n \choose k}\), read "n choose k", is defined for \(0 \leq k \leq n\) (otherwise return 0) by
\({n \choose k} = \frac{n!}{k! (n-k)!}\).
| n | total number of objects |
| k | number of objects chosen |
| std::domain_error | if either argument is negative or the result will not fit in an int type |
Definition at line 29 of file choose.hpp.
|
inline |
Enables the vectorised application of the binomial coefficient function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 52 of file choose.hpp.
|
inline |
Return the specified column of the specified matrix using start-at-1 indexing.
This is equivalent to calling m.col(i - 1) and assigning the resulting template expression to a column vector.
| T | type of the matrix |
| m | Matrix. |
| j | Column index (count from 1). |
| std::out_of_range | if j is out of range. |
|
inline |
|
inline |
Returns the dot product of columns of the specified matrices.
| T_a | type of the first matrix |
| T_b | type of the second matrix |
| a | Matrix of first vectors. |
| b | Matrix of second vectors. |
| std::domain_error | If the matrices are not the same size |
Definition at line 27 of file columns_dot_product.hpp.
|
inline |
Returns the dot product of columns of the specified matrices.
| Mat1 | type of the first matrix (must be derived from Eigen::MatrixBase) |
| Mat2 | type of the second matrix (must be derived from Eigen::MatrixBase) |
| v1 | Matrix of first vectors. |
| v2 | Matrix of second vectors. |
| std::domain_error | If the vectors are not the same size or if they are both not vector dimensioned. |
Definition at line 28 of file columns_dot_product.hpp.
|
inline |
Returns the dot product of columns of the specified matrices.
| T1 | type of the first matrix |
| T2 | type of the second matrix |
| v1 | Matrix of first vectors. |
| v2 | Matrix of second vectors. |
| std::invalid_argument | If the vectors are not the same size |
Definition at line 30 of file columns_dot_product.hpp.
|
inline |
Returns the dot product of columns of the specified matrices.
This overload is used when at least one of Mat1 and Mat2 is a var_value<T> where T inherits from EigenBase. The other argument can be another var_value or a type that inherits from EigenBase.
| Mat1 | type of the first matrix |
| Mat2 | type of the second matrix |
| v1 | Matrix of first vectors. |
| v2 | Matrix of second vectors. |
| std::domain_error | If the vectors are not the same size or if they are both not vector dimensioned. |
Definition at line 64 of file columns_dot_product.hpp.
|
inline |
Returns the dot product of each column of a matrix with itself.
| Mat | An Eigen matrix with a var scalar type. |
| x | Matrix. |
Definition at line 20 of file columns_dot_self.hpp.
|
inline |
Returns the dot product of each column of a matrix with itself.
| T | type of the matrix (must be derived from Eigen::MatrixBase) |
| x | Matrix. |
Definition at line 21 of file columns_dot_self.hpp.
|
inline |
Returns the dot product of each column of a matrix with itself.
| T | type of the matrix |
| v | Matrix. |
Definition at line 22 of file columns_dot_self.hpp.
|
inline |
Returns the dot product of each column of a matrix with itself.
| T | type of the matrix |
| a | Matrix. |
Definition at line 24 of file columns_dot_self.hpp.
|
inline |
Returns the dot product of each column of a matrix with itself.
| Mat | A var_value<> with an inner matrix type. |
| x | Matrix. |
Definition at line 36 of file columns_dot_self.hpp.
|
inline |
Broadcast an expression in colwise dimmension if the number of rows equals to 1.
In that case further expressions can use this expression as if had any number of rows, repeating the values.
Broadcasting evaluates argument expression multiple times. For performance reasons don't broadcast slow operations. Instead evaluate them in a separate kernel.
| T | type of input expression |
| a | input expression |
Definition at line 240 of file optional_broadcast.hpp.
|
inline |
Return the complex negation of the specified complex argument.
| V | value type of complex argument |
| [in] | z | argument |
Definition at line 48 of file i_times.hpp.
|
inline |
Return the negation of the first argument if the first and second argument have different signs, otherwise return a copy of the first argument.
For the sake of this function, zero is considered positive. This function uses negation rather than literally copying signs to preserve derivatives.
Overload of std::copysign from cmath for argument-dependent lookup.
| T | type of first argument |
| U | type of second argument |
| [in] | x | first complex argument |
| [in] | y | second complex argument |
Definition at line 30 of file copysign.hpp.
|
inline |
Return the complex number composed of the real and complex parts with signs copied from the real and complex parts of the first arguments to the real and complex parts of the second.
This is an overload of the standard libary copysign for complex numbers that will be used with argument-dependent lookup. Rather than using the standard library copysign, it uses copysign_non_zero, which does not change sign if the reference value is zero (-0.0 or 0.0).
| T | value type of first argument |
| U | value type of second argument |
| [in] | x | first complex argument |
| [in] | y | second complex argument |
Definition at line 72 of file copysign.hpp.
|
inline |
Return the negation of the first argument if the first and second arguments have different signs and the first argument is not zero, otherwise return a copy of the first argument.
| T | type of first argument |
| U | type of second argument |
| [in] | x | first complex argument |
| [in] | y | second complex argument |
Definition at line 49 of file copysign.hpp.
|
inline |
Return the result of transforming the specified scalar or container of values to have a valid correlation value between -1 and 1 (inclusive).
The transform used is the hyperbolic tangent function,
\(f(x) = \tanh x = \frac{\exp(2x) - 1}{\exp(2x) + 1}\).
| T | type of value or container |
| [in] | x | value or container |
Definition at line 27 of file corr_constrain.hpp.
|
inline |
Return the result of transforming the specified scalar or container of values to have a valid correlation value between -1 and 1 (inclusive).
The transform used is as specified for corr_constrain(T). The log absolute Jacobian determinant is
\(\log | \frac{d}{dx} \tanh x | = \log (1 - \tanh^2 x)\).
| T_x | Type of scalar or container |
| [in] | x | value or container |
| [in,out] | lp | log density accumulator |
Definition at line 46 of file corr_constrain.hpp.
|
inline |
Return the result of transforming the specified scalar or container of values to have a valid correlation value between -1 and 1 (inclusive).
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T_x | Type of scalar or container |
| T_lp | type of target log density accumulator |
| [in] | x | value or container |
| [in,out] | lp | log density accumulator |
Definition at line 68 of file corr_constrain.hpp.
|
inline |
Return the unconstrained scalar that when transformed to a valid correlation produces the specified value.
This function inverts the transform defined for corr_constrain(T), which is the inverse hyperbolic tangent,
\( f^{-1}(y) = \mbox{atanh}\, y = \frac{1}{2} \log \frac{y + 1}{y - 1}\).
| T | Type of correlation |
| [in] | y | correlation |
Definition at line 28 of file corr_free.hpp.
| var_value<Eigen::MatrixXd> stan::math::corr_matrix_constrain | ( | const T & | x, |
| Eigen::Index | k | ||
| ) |
Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values.
The input vector must be of length \({k \choose 2} = \frac{k(k-1)}{2}\). The values in the input vector represent unconstrained (partial) correlations among the dimensions.
The transform based on partial correlations is as specified in
The free vector entries are first constrained to be valid correlation values using corr_constrain(T).
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| x | Vector of unconstrained partial correlations. |
| k | Dimensionality of returned correlation matrix. |
| std::invalid_argument | if x is not a valid correlation matrix. |
Definition at line 41 of file corr_matrix_constrain.hpp.
|
inline |
Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values.
The input vector must be of length \({k \choose 2} = \frac{k(k-1)}{2}\). The values in the input vector represent unconstrained (partial) correlations among the dimensions.
The transform based on partial correlations is as specified in
The free vector entries are first constrained to be valid correlation values using corr_constrain(T).
| T | type of the vector (must be derived from Eigen::MatrixBase and have one compile-time dimension equal to 1) |
| x | Vector of unconstrained partial correlations. |
| k | Dimensionality of returned correlation matrix. |
| std::invalid_argument | if x is not a valid correlation matrix. |
Definition at line 41 of file corr_matrix_constrain.hpp.
| var_value<Eigen::MatrixXd> stan::math::corr_matrix_constrain | ( | const T & | x, |
| Eigen::Index | k, | ||
| scalar_type_t< T > & | lp | ||
| ) |
Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values.
The input vector must be of length \({k \choose 2} = \frac{k(k-1)}{2}\). The values in the input vector represent unconstrained (partial) correlations among the dimensions.
The transform is as specified for corr_matrix_constrain(Matrix, size_t); the paper it cites also defines the Jacobians for correlation inputs, which are composed with the correlation constrained Jacobians defined in corr_constrain(T, double) for this function.
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| x | Vector of unconstrained partial correlations. |
| k | Dimensionality of returned correlation matrix. |
| lp | Log probability reference to increment. |
Definition at line 69 of file corr_matrix_constrain.hpp.
|
inline |
Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values.
The input vector must be of length \({k \choose 2} = \frac{k(k-1)}{2}\). The values in the input vector represent unconstrained (partial) correlations among the dimensions.
The transform is as specified for corr_matrix_constrain(Matrix, size_t); the paper it cites also defines the Jacobians for correlation inputs, which are composed with the correlation constrained Jacobians defined in corr_constrain(T, double) for this function.
| T | type of the vector (must be derived from Eigen::MatrixBase and have one compile-time dimension equal to 1) |
| x | Vector of unconstrained partial correlations. |
| k | Dimensionality of returned correlation matrix. |
| lp | Log probability reference to increment. |
Definition at line 70 of file corr_matrix_constrain.hpp.
|
inline |
Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values.
The input vector must be of length \({k \choose 2} = \frac{k(k-1)}{2}\). The values in the input vector represent unconstrained (partial) correlations among the dimensions. If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| x | Vector of unconstrained partial correlations | |
| k | Dimensionality of returned correlation matrix | |
| [in,out] | lp | log density accumulator |
Definition at line 97 of file corr_matrix_constrain.hpp.
|
inline |
Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values.
The input vector must be of length \({k \choose 2} = \frac{k(k-1)}{2}\). The values in the input vector represent unconstrained (partial) correlations among the dimensions. If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| x | Vector of unconstrained partial correlations | |
| k | Dimensionality of returned correlation matrix | |
| [in,out] | lp | log density accumulator |
Definition at line 126 of file corr_matrix_constrain.hpp.
| Eigen::Matrix<value_type_t<T>, Eigen::Dynamic, 1> stan::math::corr_matrix_free | ( | const T & | y | ) |
Return the vector of unconstrained partial correlations that define the specified correlation matrix when transformed.
The constraining transform is defined as for corr_matrix_constrain(Matrix, size_t). The inverse transform in this function is simpler in that it only needs to compute the \(k \choose 2\) partial correlations and then free those.
| T | type of the matrix (must be derived from Eigen::MatrixBase) |
| y | The correlation matrix to free. |
| std::domain_error | if the correlation matrix has no elements or is not a square matrix. |
| std::runtime_error | if the correlation matrix cannot be factorized by factor_cov_matrix() or if the sds returned by factor_cov_matrix() on log scale are unconstrained. |
Definition at line 34 of file corr_matrix_free.hpp.
| auto stan::math::corr_matrix_free | ( | const T & | x | ) |
Overload of corr_matrix_free() to untransform each matrix in a standard vector.
| T | A standard vector with with a value_type which inherits from Eigen::MatrixBase. |
| x | The standard vector to untransform. |
Definition at line 63 of file corr_matrix_free.hpp.
|
inline |
Return the cosine of a radian-scaled variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \cos x = - \sin x\).
\[ \mbox{cos}(x) = \begin{cases} \cos(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{cos}(x)}{\partial x} = \begin{cases} -\sin(x) & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Variable for radians of angle. |
|
inline |
|
inline |
|
inline |
Return the hyperbolic cosine of the specified variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \cosh x = \sinh x\).
\[ \mbox{cosh}(x) = \begin{cases} \cosh(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{cosh}(x)}{\partial x} = \begin{cases} \sinh(x) & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Variable. |
|
inline |
|
inline |
|
inline |
Count the number of vars in the input argument list.
| Pargs | Types of input arguments |
Definition at line 146 of file count_vars.hpp.
|
inline |
gp_exp_quad_cov Definition at line 20 of file cov_exp_quad.hpp.
|
inline |
gp_exp_quad_cov Definition at line 31 of file cov_exp_quad.hpp.
|
inline |
gp_exp_quad_cov Definition at line 42 of file cov_exp_quad.hpp.
|
inline |
gp_exp_quad_cov Definition at line 53 of file cov_exp_quad.hpp.
|
inline |
gp_exp_quad_cov_vari Definition at line 154 of file cov_exp_quad.hpp.
|
inline |
gp_exp_quad_cov_vari Definition at line 164 of file cov_exp_quad.hpp.
| var_value<Eigen::MatrixXd> stan::math::cov_matrix_constrain | ( | const T & | x, |
| Eigen::Index | K | ||
| ) |
Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2).
See cov_matrix_free() for the inverse transform.
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| x | The vector to convert to a covariance matrix. |
| K | The number of rows and columns of the resulting covariance matrix. |
| std::invalid_argument | if (x.size() != K + (K choose 2)). |
Definition at line 32 of file cov_matrix_constrain.hpp.
|
inline |
Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2).
See cov_matrix_free() for the inverse transform.
| T | type of the vector (must be derived from Eigen::MatrixBase and have one compile-time dimension equal to 1) |
| x | The vector to convert to a covariance matrix. |
| K | The number of rows and columns of the resulting covariance matrix. |
| std::invalid_argument | if (x.size() != K + (K choose 2)). |
Definition at line 32 of file cov_matrix_constrain.hpp.
|
inline |
Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2).
| T | type of the vector (must be derived from Eigen::MatrixBase and have one compile-time dimension equal to 1) |
| x | The vector to convert to a covariance matrix. |
| K | The dimensions of the resulting covariance matrix. |
| lp | Reference |
| std::domain_error | if (x.size() != K + (K choose 2)). |
Definition at line 65 of file cov_matrix_constrain.hpp.
| var_value<Eigen::MatrixXd> stan::math::cov_matrix_constrain | ( | const T & | x, |
| Eigen::Index | K, | ||
| scalar_type_t< T > & | lp | ||
| ) |
Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2).
See cov_matrix_free() for the inverse transform.
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| x | The vector to convert to a covariance matrix. |
| K | The dimensions of the resulting covariance matrix. |
| lp | Reference |
| std::domain_error | if (x.size() != K + (K choose 2)). |
Definition at line 77 of file cov_matrix_constrain.hpp.
|
inline |
Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2).
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| x | The vector to convert to a covariance matrix | |
| K | The dimensions of the resulting covariance matrix | |
| [in,out] | lp | log density accumulator |
| std::domain_error | if (x.size() != K + (K choose 2)). |
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| x | The vector to convert to a covariance matrix | |
| K | The dimensions of the resulting covariance matrix | |
| [in,out] | lp | log density accumulator |
| std::domain_error | if (x.size() != K + (K choose 2)). |
Definition at line 108 of file cov_matrix_constrain.hpp.
| var_value<Eigen::MatrixXd> stan::math::cov_matrix_constrain_lkj | ( | const T & | x, |
| size_t | k | ||
| ) |
Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values.
The input vector must be of length \(k \choose 2 + k\). The first \(k \choose 2\) values in the input represent unconstrained (partial) correlations and the last \(k\) are unconstrained standard deviations of the dimensions.
The transform scales the correlation matrix transform defined in corr_matrix_constrain(Matrix, size_t) with the constrained deviations.
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| x | Input vector of unconstrained partial correlations and standard deviations. |
| k | Dimensionality of returned covariance matrix. |
Definition at line 35 of file cov_matrix_constrain_lkj.hpp.
|
inline |
Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values.
The input vector must be of length \(k \choose 2 + k\). The first \(k \choose 2\) values in the input represent unconstrained (partial) correlations and the last \(k\) are unconstrained standard deviations of the dimensions.
The transform scales the correlation matrix transform defined in corr_matrix_constrain(Matrix, size_t) with the constrained deviations.
| T | type of the vector (must be derived from Eigen::MatrixBase and have one compile-time dimension equal to 1) |
| x | Input vector of unconstrained partial correlations and standard deviations. |
| k | Dimensionality of returned covariance matrix. |
Definition at line 35 of file cov_matrix_constrain_lkj.hpp.
|
inline |
Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values and increment the specified log probability reference with the log absolute Jacobian determinant.
| T | type of the vector (must be derived from Eigen::MatrixBase and have one compile-time dimension equal to 1) |
| x | Input vector of unconstrained partial correlations and standard deviations. |
| k | Dimensionality of returned covariance matrix. |
| lp | Log probability reference to increment. |
Definition at line 59 of file cov_matrix_constrain_lkj.hpp.
| var_value<Eigen::MatrixXd> stan::math::cov_matrix_constrain_lkj | ( | const T & | x, |
| size_t | k, | ||
| scalar_type_t< T > & | lp | ||
| ) |
Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values and increment the specified log probability reference with the log absolute Jacobian determinant.
The transform is defined as for cov_matrix_constrain(Matrix, size_t).
The log absolute Jacobian determinant is derived by composing the log absolute Jacobian determinant for the underlying correlation matrix as defined in cov_matrix_constrain(Matrix, size_t, T&) with the Jacobian of the transform of the correlation matrix into a covariance matrix by scaling by standard deviations.
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| x | Input vector of unconstrained partial correlations and standard deviations. |
| k | Dimensionality of returned covariance matrix. |
| lp | Log probability reference to increment. |
Definition at line 67 of file cov_matrix_constrain_lkj.hpp.
|
inline |
Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values.
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time rows or columns equal to 1 |
| x | Input vector of unconstrained partial correlations and standard deviations | |
| k | Dimensionality of returned covariance matrix | |
| [in,out] | lp | log density accumulator |
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time rows or columns equal to 1 |
| x | Input vector of unconstrained partial correlations and standard deviations | |
| k | Dimensionality of returned covariance matrix | |
| [in,out] | lp | log density accumulator |
Definition at line 87 of file cov_matrix_constrain_lkj.hpp.
| Eigen::Matrix<value_type_t<T>, Eigen::Dynamic, 1> stan::math::cov_matrix_free | ( | const T & | y | ) |
The covariance matrix derived from the symmetric view of the lower-triangular view of the K by K specified matrix is freed to return a vector of size K + (K choose 2).
This is the inverse of the cov_matrix_constrain() function so that for any finite vector x of size K
x == cov_matrix_free(cov_matrix_constrain(x, K)).
In order for this round-trip to work (and really for this function to work), the symmetric view of its lower-triangular view must be positive definite.
| T | type of the matrix (must be derived from Eigen::MatrixBase) |
| y | Matrix of dimensions K by K such that he symmetric view of the lower-triangular view is positive definite. |
| std::domain_error | if y is not square, has zero dimensionality, or has a non-positive diagonal element. |
Definition at line 38 of file cov_matrix_free.hpp.
| auto stan::math::cov_matrix_free | ( | const T & | x | ) |
Overload of cov_matrix_free() to untransform each matrix in a standard vector.
| T | A standard vector with with a value_type which inherits from Eigen::MatrixBase. |
| x | The standard vector to untransform. |
Definition at line 69 of file cov_matrix_free.hpp.
| Eigen::Matrix<value_type_t<T>, Eigen::Dynamic, 1> stan::math::cov_matrix_free_lkj | ( | const T & | y | ) |
Return the vector of unconstrained partial correlations and deviations that transform to the specified covariance matrix.
The constraining transform is defined as for cov_matrix_constrain(Matrix, size_t). The inverse first factors out the deviations, then applies the freeing transform of corr_matrix_free(Matrix&).
| T | type of the matrix (must be derived from Eigen::MatrixBase) |
| y | Covariance matrix to free. |
| std::domain_error | if the correlation matrix has no elements or is not a square matrix. |
| std::runtime_error | if the correlation matrix cannot be factorized by factor_cov_matrix() |
Definition at line 31 of file cov_matrix_free_lkj.hpp.
| auto stan::math::cov_matrix_free_lkj | ( | const T & | x | ) |
Overload of cov_matrix_free_lkj() to untransform each matrix in a standard vector.
| T | A standard vector with with a value_type which inherits from Eigen::MatrixBase. |
| x | The standard vector to untransform. |
Definition at line 60 of file cov_matrix_free_lkj.hpp.
|
inline |
Returns the result of pre-multiplying a matrix by its own transpose.
| EigMat | type of the matrix (must be derived from Eigen::MatrixBase) |
| M | Matrix to multiply. |
Definition at line 20 of file crossprod.hpp.
|
inline |
Returns the result of pre-multiplying a matrix by its own transpose.
| T | type of elements in A |
| A | input matrix |
Definition at line 21 of file crossprod.hpp.
|
inline |
Returns the result of pre-multiplying a matrix by its own transpose.
| T | Type of the matrix |
| M | Matrix to multiply. |
Definition at line 22 of file crossprod.hpp.
|
inline |
Definition at line 75 of file csr_matrix_times_vector.hpp.
|
inline |
Definition at line 78 of file csr_matrix_times_vector.hpp.
|
inline |
Return the cumulative sum of the specified vector.
The cumulative sum of a vector of values
| T | type of elements in the vector |
| x | Vector of values. |
Definition at line 25 of file cumulative_sum.hpp.
|
inline |
Return the cumulative sum of the specified vector.
The cumulative sum of a vector of values
| T | type of the vector |
| x | Vector of values. |
Definition at line 25 of file cumulative_sum.hpp.
|
inline |
Return the cumulative sum of the specified vector.
The cumulative sum of a vector of values
| T | scalar type of the vector |
| A | Vector of values |
Definition at line 26 of file cumulative_sum.hpp.
|
inline |
Return the cumulative sum of the specified vector.
The cumulative sum is of the same type as the input and has values defined by
| EigVec | type of the vector (must be derived from Eigen::MatrixBase and have one compile time dimension equal to 1) |
| m | Vector of values. |
Definition at line 49 of file cumulative_sum.hpp.
|
inline |
Definition at line 13 of file cvodes_utils.hpp.
|
inline |
Definition at line 24 of file cvodes_utils.hpp.
|
inline |
Forward arguments that do not contain vars.
There is no copying to be done.
| Arith | an arithmetic type. |
| arg | For lvalue references this will be passed by reference. Otherwise it will be moved. |
Definition at line 23 of file deep_copy_vars.hpp.
|
inline |
Copy the value of a var but reallocate a new vari.
| arg | A var |
Definition at line 33 of file deep_copy_vars.hpp.
|
inline |
Copy the vars in arg but reallocate new varis for them.
| VarVec | A variant of std::vector<var> |
| arg | A std::vector of vars |
Definition at line 45 of file deep_copy_vars.hpp.
|
inline |
Copy the vars in arg but reallocate new varis for them.
| VecContainer | std::vector<T> where T is another type containing vars |
| arg | A std::vector of containers containing vars |
Definition at line 63 of file deep_copy_vars.hpp.
|
inline |
Copy the vars in arg but reallocate new varis for them.
| EigT | An Eigen type with var value type |
| arg | An Eigen container of vars |
Definition at line 79 of file deep_copy_vars.hpp.
| void stan::math::derivative | ( | const F & | f, |
| const T & | x, | ||
| T & | fx, | ||
| T & | dfx_dx | ||
| ) |
Return the derivative of the specified univariate function at the specified argument.
| T | Argument type |
| F | Function type |
| [in] | f | Function |
| [in] | x | Argument |
| [out] | fx | Value of function applied to argument |
| [out] | dfx_dx | Value of derivative |
Definition at line 24 of file derivative.hpp.
|
inline |
Definition at line 13 of file determinant.hpp.
|
inline |
Definition at line 14 of file determinant.hpp.
|
inline |
Returns the determinant of the specified square matrix.
| T | type of the matrix (must be derived from Eigen::MatrixBase) |
| m | Specified matrix. |
| std::domain_error | if matrix is not square. |
Definition at line 21 of file determinant.hpp.
|
inline |
Return a square diagonal matrix with the specified vector of coefficients as the diagonal values.
| EigVec | type of the vector (must be derived from Eigen::MatrixBase and have one compile time dimmension equal to 1) |
| [in] | v | Specified vector. |
Definition at line 21 of file diag_matrix.hpp.
|
inline |
Return a square diagonal matrix with the specified vector of coefficients as the diagonal values.
| [in] | v | Specified vector. |
Definition at line 21 of file diag_matrix.hpp.
|
inline |
Return a square diagonal matrix with the specified vector of coefficients as the diagonal values.
| T_x | type of input kernel generator expression for the diagonal |
| x | input kernel generator expression for the diagonal |
Definition at line 25 of file diag_matrix.hpp.
| auto stan::math::diag_post_multiply | ( | const T1 & | m1, |
| const T2 & | m2 | ||
| ) |
Return the product of the matrix and the diagonal matrix formed from the vector or row_vector.
Return the product of the matrix and a diagonal matrix formed from the vector or row_vector.
| T1 | type of the matrix |
| T2 | type of the vector/row_vector |
| m1 | input matrix |
| m2 | input vector/row_vector |
Definition at line 25 of file diag_post_multiply.hpp.
|
inline |
Return the product of a matrix and the diagonal matrix formed from the vector or row_vector.
| T1 | type of the matrix |
| T2 | type of the vector/row_vector |
| m1 | input matrix |
| m2 | input vector/row_vector |
Definition at line 25 of file diag_post_multiply.hpp.
|
inline |
Return the product of a matrix and the diagonal matrix formed from the vector or row_vector.
| T1 | type of the matrix |
| T2 | type of the vector/row_vector |
| v1 | input matrix |
| v2 | input vector/row_vector |
Definition at line 30 of file diag_post_multiply.hpp.
| auto stan::math::diag_pre_multiply | ( | const T1 & | m1, |
| const T2 & | m2 | ||
| ) |
Return the product of the diagonal matrix formed from the vector or row_vector and a matrix.
| T1 | type of the vector/row_vector |
| T2 | type of the matrix |
| m1 | input vector/row_vector |
| m2 | input matrix |
Definition at line 25 of file diag_pre_multiply.hpp.
|
inline |
Return the product of the diagonal matrix formed from the vector or row_vector and a matrix.
| T1 | type of the vector/row_vector |
| T2 | type of the matrix |
| m1 | input vector/row_vector |
| m2 | input matrix |
Definition at line 25 of file diag_pre_multiply.hpp.
|
inline |
Return the product of the diagonal matrix formed from the vector or row_vector and a matrix.
| T1 | type of the vector/row_vector |
| T2 | type of the matrix |
| v1 | input vector/row_vector |
| v2 | input matrix |
Definition at line 30 of file diag_pre_multiply.hpp.
|
inline |
Return a column vector of the diagonal elements of the specified matrix.
The matrix is not required to be square.
| T | type of the matrix |
| m | Specified matrix. |
Definition at line 19 of file diagonal.hpp.
|
inline |
Return a column vector of the diagonal elements of the specified matrix.
The matrix is not required to be square.
| M | Specified matrix. |
Definition at line 21 of file diagonal.hpp.
|
inline |
Returns the elementwise digamma() of a var_value<matrix_cl<double>>.
| A | argument |
digamma() of the input. Definition at line 18 of file digamma.hpp.
Return the derivative of the log gamma function at the specified value.
| [in] | a | argument |
Definition at line 19 of file digamma.hpp.
Return the derivative of the log gamma function at the specified argument.
| T | inner type of the fvar |
| [in] | x | argument |
Definition at line 23 of file digamma.hpp.
|
inline |
Return the elementwise derivative of the log gamma function at the given input vector.
| [in] | a | vector |
Definition at line 34 of file digamma.hpp.
|
inline |
Return the derivative of the log gamma function at the specified value.
\[ \mbox{digamma}(x) = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \Psi(x) & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{digamma}(x)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \frac{\partial\, \Psi(x)}{\partial x} & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \Psi(x)=\frac{\Gamma'(x)}{\Gamma(x)} \]
\[ \frac{\partial \, \Psi(x)}{\partial x} = \frac{\Gamma''(x)\Gamma(x)-(\Gamma'(x))^2}{\Gamma^2(x)} \]
The design follows the standard C++ library in returning NaN rather than throwing exceptions.
| [in] | x | argument |
Definition at line 47 of file digamma.hpp.
|
inline |
Vectorized version of digamma().
| T | type of container |
| x | container |
| std::domain_error | if any value is a negative integer or 0 |
Definition at line 77 of file digamma.hpp.
|
inline |
|
inline |
Pushes dimensions of given argument into given result vector.
For var_value that is the dimensions of inner vari_value.
| type | in var_value |
| x | argument |
| result | result |
|
inline |
Pushes dimensions of given argument into given result vector.
For vari_value containing Eigen type those are the numbers of rows and columns.
| x | argument |
| result | result |
|
inline |
|
inline |
| return_type_t<T_prob, T_prior_size> stan::math::dirichlet_lpdf | ( | const T_prob & | theta, |
| const T_prior_size & | alpha | ||
| ) |
Definition at line 130 of file dirichlet_lpdf.hpp.
| return_type_t<T_prob, T_prior_size> stan::math::dirichlet_lpmf | ( | const T_prob & | theta, |
| const T_prior_size & | alpha | ||
| ) |
Definition at line 20 of file dirichlet_lpmf.hpp.
|
inline |
Definition at line 93 of file discrete_range_lpmf.hpp.
|
inline |
Returns the distance between two scalars.
Returns the distance between the specified vectors.
| T1 | type of first scalar. |
| T2 | type of second scalar |
| x1 | First scalar. |
| x2 | Second scalar. |
| std::domain_error | If the arguments are not finite. |
| T1 | type of the first vector (must be derived from Eigen::MatrixBase and have one compile time dimension equal to 1) |
| T2 | type of the second vector (must be derived from Eigen::MatrixBase and have one compile time dimension equal to 1) |
| x1 | First vector. |
| x2 | Second vector. |
| std::domain_error | If the vectors are not the same size. |
Definition at line 27 of file distance.hpp.
|
inline |
Returns the distance between the specified vectors.
| T_a | type of the first kernel generator expression |
| T_b | type of the second kernel generator expression |
| a | first kernel generator expression |
| b | second kernel generator expression |
| std::domain_error | If the matrices are not the same size |
Definition at line 33 of file distance.hpp.
|
inline |
Return the division of the first scalar by the second scalar.
| [in] | x | Specified scalar. |
| [in] | y | Specified scalar. |
Definition at line 24 of file divide.hpp.
|
inline |
Definition at line 28 of file divide.hpp.
|
inline |
Elementwise division of a kernel generator expression and a scalar.
| T_a | type of the kernel generator expression |
| T_b | type of the scalar |
| a | input kernel generator expression |
| b | scalar |
Definition at line 32 of file divide.hpp.
|
inline |
Return matrix divided by scalar.
| Mat | type of the matrix or expression |
| Scal | type of the scalar |
| [in] | m | specified matrix or expression |
| [in] | c | specified scalar |
Definition at line 46 of file divide.hpp.
|
inline |
Return matrix divided by scalar.
| Mat | A type inheriting from EigenBase with an Arithmetic scalar type. |
| [in] | m | specified matrix or expression |
| [in] | c | specified scalar |
Definition at line 126 of file operator_division.hpp.
|
inline |
Return scalar divided by matrix.
| Mat | Either a type inheriting from EigenBase with a scalar type of var or a var_value<T> with type T inheriting from EigenBase. |
| [in] | m | specified matrix or expression |
| [in] | c | specified scalar |
Definition at line 170 of file operator_division.hpp.
|
inline |
Return a matrix divided by a matrix elementwise.
| Mat1 | Either a type inheriting from EigenBase or a var_value<T> with type T inheriting from EigenBase. |
| Mat2 | Either a type inheriting from EigenBase or a var_value<T> with type T inheriting from EigenBase. |
| [in] | m1 | specified matrix or expression |
| [in] | m2 | specified matrix or expression |
Definition at line 215 of file operator_division.hpp.
|
inline |
Takes Stan data type vector[n] x[D] and divides column vector in x element-wise by the values in vec.
| T_x | Type of dividend |
| T_v | Scalar type of divisor |
| x | std::vector of matrices |
| vec | std::vector of divisors |
| std::invalid | argument if D != length of vector |
Definition at line 25 of file divide_columns.hpp.
| return_type_t<double, T_shape> stan::math::do_lkj_constant | ( | const T_shape & | eta, |
| const unsigned int & | K | ||
| ) |
Definition at line 16 of file lkj_corr_lpdf.hpp.
|
inline |
throw_domain_error Definition at line 14 of file domain_error.hpp.
|
inline |
throw_domain_error Definition at line 23 of file domain_error.hpp.
|
inline |
throw_domain_error_vec Definition at line 13 of file domain_error_vec.hpp.
|
inline |
throw_domain_error_vec Definition at line 22 of file domain_error_vec.hpp.
|
inline |
|
inline |
Returns the dot product of the specified vectors.
| v1 | First vector. |
| v2 | Second vector. |
| std::invalid_argument | If the vectors are not the same size or if they are both not vector dimensioned. |
Definition at line 24 of file dot_product.hpp.
|
inline |
Returns the dot product of the specified vectors.
| T_a | type of the first vector |
| T_b | type of the second vector |
| a | First vector. |
| b | Second vector. |
| std::invalid_argument | If the vectors are not the same size or if they are both not vector dimensioned. |
Definition at line 26 of file dot_product.hpp.
|
inline |
Returns the dot product.
| T1 | type of the first vector |
| T2 | type of the second vector |
| [in] | v1 | First vector. |
| [in] | v2 | Second vector. |
| std::domain_error | if sizes of v1 and v2 do not match. |
Definition at line 28 of file dot_product.hpp.
|
inline |
Returns the dot product.
| T1 | type of elements in the first vector |
| T2 | type of elements in the second vector |
| [in] | v1 | First vector. |
| [in] | v2 | Second vector. |
| std::domain_error | if sizes of v1 and v2 do not match. |
Definition at line 38 of file dot_product.hpp.
|
inline |
Returns the dot product of the specified arrays.
| v1 | First array. |
| v2 | Second array. |
| length | Length of both arrays. |
Definition at line 39 of file dot_product.hpp.
|
inline |
Returns the dot product of the specified arrays.
| v1 | First array. |
| v2 | Second array. |
| std::domain_error | if the vectors are not the same size. |
Definition at line 56 of file dot_product.hpp.
|
inline |
Definition at line 13 of file dot_self.hpp.
|
inline |
Returns the dot product of a vector of var with itself.
| T | type of the vector |
| [in] | v | Vector. |
Definition at line 21 of file dot_self.hpp.
|
inline |
Returns squared norm of a vector or matrix.
For vectors that equals the dot product of the specified vector with itself.
| T | type of the vector |
| a | Vector. |
Definition at line 21 of file dot_self.hpp.
|
inline |
Returns the dot product of a vector of var with itself.
Returns the dot product of a var_value<Vector> with itself.
| T | type of the vector (must have one compile time dimension equal to 1) |
| [in] | v | Vector. |
| A | var_value<> whose inner type has one compile time row or column. |
| [in] | v | Vector. |
Definition at line 24 of file dot_self.hpp.
|
inline |
Returns squared norm of a vector or matrix.
For vectors that equals the dot product of the specified vector with itself.
| T | type of the vector (must be derived from Eigen::MatrixBase) |
| v | Vector. |
Definition at line 30 of file dot_self.hpp.
| return_type_t<T_y, T_loc, T_scale> stan::math::double_exponential_lpdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 110 of file double_exponential_lpdf.hpp.
|
static |
Return the base of the natural logarithm.
Definition at line 20 of file constants.hpp.
|
static |
Return the Euler's gamma constant.
Definition at line 27 of file constants.hpp.
| Eigen::Matrix<std::complex<T>, -1, 1> stan::math::eigenvalues | ( | const Eigen::Matrix< T,-1,-1 > & | m | ) |
Definition at line 11 of file eigenvalues.hpp.
Definition at line 11 of file eigenvalues_sym.hpp.
| Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, 1> stan::math::eigenvalues_sym | ( | const EigMat & | m | ) |
Return the eigenvalues of the specified symmetric matrix in descending order of magnitude.
This function is more efficient than the general eigenvalues function for symmetric matrices.
See eigen_decompose() for more information.
| EigMat | type of the matrix |
| m | Specified matrix. |
Definition at line 24 of file eigenvalues_sym.hpp.
|
inline |
Return the eigenvalues of the specified symmetric matrix.
See eigen_decompose() for more information.
| T | type of input matrix. |
| m | Specified matrix. |
Definition at line 25 of file eigenvalues_sym.hpp.
| Eigen::Matrix<std::complex<T>, -1, -1> stan::math::eigenvectors | ( | const Eigen::Matrix< T,-1,-1 > & | m | ) |
Definition at line 11 of file eigenvectors.hpp.
Definition at line 11 of file eigenvectors_sym.hpp.
| Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, Eigen::Dynamic> stan::math::eigenvectors_sym | ( | const EigMat & | m | ) |
Definition at line 14 of file eigenvectors_sym.hpp.
|
inline |
Return the eigenvectors of the specified symmetric matrix.
See eigen_decompose() for more information.
| T | type of input matrix. |
| m | Specified matrix. |
Definition at line 25 of file eigenvectors_sym.hpp.
|
inline |
Check that the predicate holds for the value of x.
Check that the predicate holds for all elements of the value of x.
This overload works on scalars.
| F | type of predicate |
| T | type of x |
| Indexings | types of indexings |
| is_good | predicate to check, must accept doubles and produce bools |
| function | function name (for error messages) |
| name | variable name (for error messages) |
| x | variable to check, can be a scalar, a container of scalars, a container of containers of scalars, etc |
| must_be | message describing what the value should be |
| indexings | any additional indexing to print. Intended for internal use in elementwise_check only. |
| <tt>std::domain_error</tt> | if is_good returns false for the value of any element in x |
This overload works on std::vector types.
| F | type of predicate |
| T | type of x |
| Indexings | types of indexings |
| is_good | predicate to check, must accept doubles and produce bools |
| function | function name (for error messages) |
| name | variable name (for error messages) |
| x | variable to check, can be a scalar, a container of scalars, a container of containers of scalars, etc |
| must_be | message describing what the value should be |
| indexings | any additional indexing to print. Intended for internal use in elementwise_check only. |
| <tt>std::domain_error</tt> | if is_good returns false for the value of any element in x |
This overload works on vars containing Eigen types.
| F | type of predicate |
| T | type of x |
| Indexings | types of indexings |
| is_good | predicate to check, must accept doubles and produce bools |
| function | function name (for error messages) |
| name | variable name (for error messages) |
| x | variable to check, can be a scalar, a container of scalars, a container of containers of scalars, etc |
| must_be | message describing what the value should be |
| indexings | any additional indexing to print. Intended for internal use in elementwise_check only. |
| <tt>std::domain_error</tt> | if is_good returns false for the value of any element in x |
Definition at line 116 of file elementwise_check.hpp.
|
inline |
Check that the predicate holds for all elements of the value of x.
Check that the predicate holds for all the elements of the value of x.
This overload works on Eigen types that support linear indexing.
| F | type of predicate |
| T | type of x |
| Indexings | types of indexings |
| is_good | predicate to check, must accept doubles and produce bools |
| function | function name (for error messages) |
| name | variable name (for error messages) |
| x | variable to check, can be a scalar, a container of scalars, a container of containers of scalars, etc |
| must_be | message describing what the value should be |
| indexings | any additional indexing to print. Intended for internal use in elementwise_check only. |
| <tt>std::domain_error</tt> | if is_good returns false for the value of any element in x |
This overload works on col-major Eigen types that do not support linear indexing.
| F | type of predicate |
| T | type of x |
| Indexings | types of indexings |
| is_good | predicate to check, must accept doubles and produce bools |
| function | function name (for error messages) |
| name | variable name (for error messages) |
| x | variable to check, can be a scalar, a container of scalars, a container of containers of scalars, etc |
| must_be | message describing what the value should be |
| indexings | any additional indexing to print. Intended for internal use in elementwise_check only. |
| <tt>std::domain_error</tt> | if is_good returns false for the value of any element in x |
This overload works on row-major Eigen types that do not support linear indexing.
| F | type of predicate |
| T | type of x |
| Indexings | types of indexings |
| is_good | predicate to check, must accept doubles and produce bools |
| function | function name (for error messages) |
| name | variable name (for error messages) |
| x | variable to check, can be a scalar, a container of scalars, a container of containers of scalars, etc |
| must_be | message describing what the value should be |
| indexings | any additional indexing to print. Intended for internal use in elementwise_check only. |
| <tt>std::domain_error</tt> | if is_good returns false for the value of any element in x |
Definition at line 150 of file elementwise_check.hpp.
|
inline |
Check that the predicate holds for the value of x, working elementwise on containers.
If x is a scalar, check the double underlying the scalar. If x is a container, check each element inside x, recursively.
| F | type of predicate |
| T | type of x |
| is_good | predicate to check, must accept doubles and produce bools |
| x | variable to check, can be a scalar, a container of scalars, a container of containers of scalars, etc |
false if any of the scalars fail the error check Definition at line 333 of file elementwise_check.hpp.
| auto stan::math::elt_divide | ( | const Mat1 & | m1, |
| const Mat2 & | m2 | ||
| ) |
Return the elementwise division of the specified matrices.
| Mat1 | type of the first matrix or expression |
| Mat2 | type of the second matrix or expression |
| m1 | First matrix or expression |
| m2 | Second matrix or expression |
| Mat1 | type of the first matrix |
| Mat2 | type of the second matrix |
| m1 | First matrix |
| m2 | Second matrix |
Definition at line 25 of file elt_divide.hpp.
|
inline |
Elementwise division of two reverse mode matrices and/or kernel generator expressions.
| T_a | type of first expression |
| T_b | type of second expression |
| a | first expression |
| b | second expression |
Definition at line 31 of file elt_divide.hpp.
| auto stan::math::elt_divide | ( | const Mat & | m, |
| Scal | s | ||
| ) |
Return the elementwise division of the specified matrix by the specified scalar.
| Mat | type of the matrix or expression |
| Scal | type of the scalar |
| m | matrix or expression |
| s | scalar |
Definition at line 43 of file elt_divide.hpp.
| auto stan::math::elt_divide | ( | Scal | s, |
| const Mat & | m | ||
| ) |
Return the elementwise division of the specified scalar by the specified matrix.
| Scal | type of the scalar |
| Mat | type of the matrix or expression |
| s | scalar |
| m | matrix or expression |
| Scal | type of the scalar |
| Mat | type of the matrix |
| s | scalar |
| m | matrix or expression |
Definition at line 60 of file elt_divide.hpp.
| auto stan::math::elt_divide | ( | Scal1 | s1, |
| Scal2 | s2 | ||
| ) |
Definition at line 66 of file elt_divide.hpp.
| auto stan::math::elt_multiply | ( | const Mat1 & | m1, |
| const Mat2 & | m2 | ||
| ) |
Return the elementwise multiplication of the specified matrices.
| Mat1 | type of the first matrix or expression |
| Mat2 | type of the second matrix or expression |
| m1 | First matrix or expression |
| m2 | Second matrix or expression |
Definition at line 26 of file elt_multiply.hpp.
|
inline |
Elementwise multiplication of two reverse mode matrices and/or kernel generator expressions.
| T_a | type of first expression |
| T_b | type of second expression |
| a | first expression |
| b | second expression |
Definition at line 31 of file elt_multiply.hpp.
| auto stan::math::elt_multiply | ( | const Scalar1 & | a, |
| const Scalar2 & | b | ||
| ) |
Return the elementwise multiplication of the specified scalars.
| Mat1 | type of the first scalar |
| Mat2 | type of the second scalar |
| a | First scalar |
| b | Second scalar |
Definition at line 44 of file elt_multiply.hpp.
|
inline |
Return specified matrix multiplied by specified scalar.
One argument is a matrix and one is a scalar.
| T1 | type of the first argument |
| T2 | type of the second argument |
| A | first argument |
| B | second argument |
Definition at line 62 of file elt_multiply.hpp.
|
inlinestatic |
Return true if there is no nested autodiff being executed.
Definition at line 12 of file empty_nested.hpp.
|
inline |
The error function for variables (C99).
The derivative is
\(\frac{d}{dx} \mbox{erf}(x) = \frac{2}{\sqrt{\pi}} \exp(-x^2)\).
\[ \mbox{erf}(x) = \begin{cases} \operatorname{erf}(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{erf}(x)}{\partial x} = \begin{cases} \frac{\partial\, \operatorname{erf}(x)}{\partial x} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \operatorname{erf}(x)=\frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}dt \]
\[ \frac{\partial \, \operatorname{erf}(x)}{\partial x} = \frac{2}{\sqrt{\pi}} e^{-x^2} \]
| a | The variable. |
|
inline |
|
inline |
The complementary error function for variables (C99).
The derivative is
\(\frac{d}{dx} \mbox{erfc}(x) = - \frac{2}{\sqrt{\pi}} \exp(-x^2)\).
\[ \mbox{erfc}(x) = \begin{cases} \operatorname{erfc}(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{erfc}(x)}{\partial x} = \begin{cases} \frac{\partial\, \operatorname{erfc}(x)}{\partial x} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \operatorname{erfc}(x)=\frac{2}{\sqrt{\pi}}\int_x^\infty e^{-t^2}dt \]
\[ \frac{\partial \, \operatorname{erfc}(x)}{\partial x} = -\frac{2}{\sqrt{\pi}} e^{-x^2} \]
| a | The variable. |
|
inline |
|
inline |
Inputs which have a plain_type equal to the own time are forwarded unmodified (for Eigen expressions these types are different)
| T | Input type |
| [in] | arg | Input argument |
|
inline |
Inputs which have a plain_type different from their own type are Eval'd (this catches Eigen expressions)
| T | Input type |
| [in] | arg | Input argument |
Return the exponentiation of the specified variable (cmath).
\[ \mbox{exp}(x) = \begin{cases} e^x & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{exp}(x)}{\partial x} = \begin{cases} e^x & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Variable to exponentiate. |
|
inline |
Return the elementwise exp() of the specified argument, which may be a scalar or any Stan container of numeric scalars.
The return type is the same as the argument type.
| Container | type of container |
| [in] | x | container |
|
inline |
|
inline |
Exponentiation base 2 function for variables (C99).
The derivative is
\(\frac{d}{dx} 2^x = (\log 2) 2^x\).
\[ \mbox{exp2}(x) = \begin{cases} 2^x & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{exp2}(x)}{\partial x} = \begin{cases} 2^x\ln2 & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | The variable. |
|
inline |
Return the elementwise exp2() of the specified argument, which may be a scalar or any Stan container of numeric scalars.
The return type is the same as the argument type.
| T | type of container |
| x | container |
|
inline |
| return_type_t<T_y, T_loc, T_scale, T_inv_scale> stan::math::exp_mod_normal_cdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma, | ||
| const T_inv_scale & | lambda | ||
| ) |
Definition at line 29 of file exp_mod_normal_cdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_inv_scale> stan::math::exp_mod_normal_lccdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma, | ||
| const T_inv_scale & | lambda | ||
| ) |
Definition at line 31 of file exp_mod_normal_lccdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_inv_scale> stan::math::exp_mod_normal_lcdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma, | ||
| const T_inv_scale & | lambda | ||
| ) |
Definition at line 31 of file exp_mod_normal_lcdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_inv_scale> stan::math::exp_mod_normal_lpdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma, | ||
| const T_inv_scale & | lambda | ||
| ) |
Definition at line 29 of file exp_mod_normal_lpdf.hpp.
|
inline |
Definition at line 122 of file exp_mod_normal_lpdf.hpp.
The exponentiation of the specified variable minus 1 (C99).
The derivative is given by
\(\frac{d}{dx} \exp(a) - 1 = \exp(a)\).
\[ \mbox{expm1}(x) = \begin{cases} e^x-1 & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{expm1}(x)}{\partial x} = \begin{cases} e^x & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | The variable. |
|
inline |
Return the elementwise expm1() of the specified argument, which may be a scalar or any Stan container of numeric scalars.
The return type is the same as the argument type.
| T | type of container |
| x | container |
|
inline |
| return_type_t<T_y, T_inv_scale> stan::math::exponential_lccdf | ( | const T_y & | y, |
| const T_inv_scale & | beta | ||
| ) |
Definition at line 20 of file exponential_lccdf.hpp.
| return_type_t<T_y, T_inv_scale> stan::math::exponential_lcdf | ( | const T_y & | y, |
| const T_inv_scale & | beta | ||
| ) |
Definition at line 24 of file exponential_lcdf.hpp.
|
inline |
Definition at line 106 of file exponential_lpdf.hpp.
| T stan::math::F32 | ( | const T & | a1, |
| const T & | a2, | ||
| const T & | a3, | ||
| const T & | b1, | ||
| const T & | b2, | ||
| const T & | z, | ||
| double | precision = 1e-6, |
||
| int | max_steps = 1e5 |
||
| ) |
Hypergeometric function (3F2).
Function reference: http://dlmf.nist.gov/16.2
\[ _3F_2 \left( \begin{matrix}a_1 a_2 a3 \\ b_1 b_2\end{matrix}; z \right) = \sum_k=0^\infty \frac{(a_1)_k(a_2)_k(a_3)_k}{(b_1)_k(b_2)_k}\frac{z^k}{k!} \]
Where _k$ is an upper shifted factorial.
Calculate the hypergeometric function (3F2) as the power series directly to within precision or until max_steps terms.
This function does not have a closed form but will converge if:
|z| is less than 1|z| is equal to one and b1 + b2 < a1 + a2 + a3 This function is a rational polynomial ifa1, a2, or a3 is a non-positive integer This function can be treated as a rational polynomial ifb1 or b2 is a non-positive integer and the series is terminated prior to the final term.| T | type of arguments and result |
| [in] | a1 | a1 (always called with 1 from beta binomial cdfs) |
| [in] | a2 | a2 (always called with a2 > 1) |
| [in] | a3 | a3 (always called with int a3 <= 0) |
| [in] | b1 | b1 (always called with int b1 < |a3|) |
| [in] | b2 | b2 (always <= 1) |
| [in] | z | z (is always called with 1 from beta binomial cdfs) |
| [in] | precision | precision of the infinite sum. defaults to 1e-6 |
| [in] | max_steps | number of steps to take. defaults to 1e5 |
| auto stan::math::fabs | ( | T | x | ) |
Return the absolute value of the variable (cmath).
Choosing an arbitrary value at the non-differentiable point 0,
\(\frac{d}{dx}|x| = \mbox{sgn}(x)\).
where \(\mbox{sgn}(x)\) is the signum function, taking values -1 if \(x < 0\), 0 if \(x == 0\), and 1 if \(x == 1\).
The function abs() provides the same behavior, with abs() defined in stdlib.h and fabs() defined in cmath. The derivative is 0 if the input is 0.
Returns std::numeric_limits<double>::quiet_NaN() for NaN inputs.
\[ \mbox{fabs}(x) = \begin{cases} |x| & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fabs}(x)}{\partial x} = \begin{cases} -1 & \mbox{if } x < 0 \\ 0 & \mbox{if } x = 0 \\ 1 & \mbox{if } x > 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Input variable. |
|
inline |
|
inline |
|
inline |
| bool stan::math::factor_cov_matrix | ( | const T_Sigma & | Sigma, |
| T_CPCs && | CPCs, | ||
| T_sds && | sds | ||
| ) |
This function is intended to make starting values, given a covariance matrix Sigma.
The transformations are hard coded as log for standard deviations and Fisher transformations (atanh()) of CPCs
| T | type of elements in the matrix and arrays |
| [in] | Sigma | covariance matrix |
| [out] | CPCs | fill this unbounded (does not resize) |
| [out] | sds | fill this unbounded |
Definition at line 28 of file factor_cov_matrix.hpp.
| void stan::math::factor_U | ( | const T_U & | U, |
| T_CPCs && | CPCs | ||
| ) |
This function is intended to make starting values, given a unit upper-triangular matrix U such that U'DU is a correlation matrix.
| T | type of elements in the matrix |
| U | Sigma matrix |
| CPCs | fill this unbounded |
Definition at line 25 of file factor_U.hpp.
Definition at line 12 of file falling_factorial.hpp.
|
inline |
Definition at line 22 of file falling_factorial.hpp.
Return autodiff variable with the gradient and result of the falling factorial function applied to the inputs.
Will throw for NaN x and for negative n, as implemented in primitive function.
| T | inner type of the fvar |
| x | Argument. |
| n | Argument |
Definition at line 26 of file falling_factorial.hpp.
|
inline |
Return the falling factorial function evaluated at the inputs.
Will throw for NaN x and for negative n
| T | Type of x argument. |
| x | Argument. |
| n | Argument |
| std::domain_error | if x is NaN |
| std::domain_error | if n is negative |
\[ \mbox{falling\_factorial}(x, n) = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ (x)_n & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{falling\_factorial}(x, n)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \frac{\partial\, (x)_n}{\partial x} & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{falling\_factorial}(x, n)}{\partial n} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \frac{\partial\, (x)_n}{\partial n} & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
\[ (x)_n=\frac{\Gamma(x+1)}{\Gamma(x-n+1)} \]
\[ \frac{\partial \, (x)_n}{\partial x} = (x)_n\Psi(x+1) \]
\[ \frac{\partial \, (x)_n}{\partial n} = -(x)_n\Psi(n+1) \]
Definition at line 64 of file falling_factorial.hpp.
|
inline |
Enables the vectorised application of the falling factorial function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 83 of file falling_factorial.hpp.
|
inline |
|
inline |
Enables the vectorised application of the fdim function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
|
inline |
Return the positive difference between the first variable's the value and the second's (C99, C++11).
The function values and derivatives are defined by
\[ \mbox{fdim}(x, y) = \begin{cases} x-y & \mbox{if } x > y \\[6pt] 0 & \mbox{otherwise} \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fdim}(x, y)}{\partial x} = \begin{cases} 1 & \mbox{if } x > y \\[6pt] 0 & \mbox{otherwise} \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fdim}(x, y)}{\partial y} = \begin{cases} -1 & \mbox{if } x > y \\[6pt] 0 & \mbox{otherwise} \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Return the positive difference between the first variable's the value and the second's (C99, C++11).
The function values and derivatives are defined by
\[ \mbox{fdim}(x, y) = \begin{cases} x-y & \mbox{if } x > y \\[6pt] 0 & \mbox{otherwise} \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fdim}(x, y)}{\partial x} = \begin{cases} 1 & \mbox{if } x > y \\[6pt] 0 & \mbox{otherwise} \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fdim}(x, y)}{\partial y} = \begin{cases} -1 & \mbox{if } x > y \\[6pt] 0 & \mbox{otherwise} \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Return the positive difference between the first value and the value of the second variable (C99, C++11).
See fdim(var, var) for definitions of values and derivatives.
| a | First value. |
| b | Second variable. |
Return the positive difference between the first variable's value and the second value (C99, C++11).
See fdim(var, var) for definitions of values and derivatives.
| a | First value. |
| b | Second variable. |
|
inline |
|
inline |
Fill the specified container with the specified value.
The specified matrix is filled by element.
| VarMat | a var_value with inner type from EigenBase |
| S | A var. |
| x | Container. |
| y | Value. |
The specified matrix is filled by element.
| VarMat | a var_value with inner type from EigenBase |
| S | An arithmetic type. |
| x | Container. |
| y | Value. |
|
inline |
|
inline |
| void stan::math::finite_diff_grad_hessian | ( | const F & | f, |
| const Eigen::VectorXd & | x, | ||
| double & | fx, | ||
| Eigen::MatrixXd & | hess, | ||
| std::vector< Eigen::MatrixXd > & | grad_hess_fx, | ||
| double | epsilon = 1e-04 |
||
| ) |
Calculate the value and the gradient of the hessian of the specified function at the specified argument using second-order autodiff and first-order finite difference.
The functor must implement
double operator()(const Eigen::Matrix<double, Eigen::Dynamic, 1>&)
Reference:
De Levie: An improved numerical approximation for the first derivative, page 3
4 calls to the function, f.
| F | Type of function |
| [in] | f | Function |
| [in] | x | Argument to function |
| [out] | fx | Function applied to argument |
| [out] | hess | Hessian matrix |
| [out] | grad_hess_fx | gradient of Hessian of function at argument |
| [in] | epsilon | perturbation size |
Definition at line 41 of file finite_diff_grad_hessian.hpp.
| void stan::math::finite_diff_grad_hessian_auto | ( | const F & | f, |
| const Eigen::VectorXd & | x, | ||
| double & | fx, | ||
| Eigen::MatrixXd & | hess, | ||
| std::vector< Eigen::MatrixXd > & | grad_hess_fx | ||
| ) |
Calculate the value, Hessian, and the gradient of the Hessian of the specified function at the specified argument using second-order autodiff and first-order finite difference.
The functor must implement
double operator()(const Eigen::VectorXd&) const;
Reference for finite difference to compute gradient:
De Levie: An improved numerical approximation for the first derivative, page 3
Step size for dimension i is set automatically using stan::math::finite_diff_stepsize(H(i, j)); the nested finite differences are over entries in the Hessian.
Evaluating this function involves 6 calls to the Hessian autodiff function for each entry in the Hessian.
| F | Type of function |
| [in] | f | Function |
| [in] | x | Argument to function |
| [out] | fx | Function applied to argument |
| [out] | hess | Hessian matrix |
| [out] | grad_hess_fx | gradient of Hessian of function at argument |
Definition at line 44 of file finite_diff_grad_hessian_auto.hpp.
| void stan::math::finite_diff_gradient | ( | const F & | f, |
| const Eigen::VectorXd & | x, | ||
| double & | fx, | ||
| Eigen::VectorXd & | grad_fx, | ||
| double | epsilon = 1e-03 |
||
| ) |
Calculate the value and the gradient of the specified function at the specified argument using finite difference.
The functor must implement
double operator()(const Eigen::Matrix<double, -1, 1>&) const;
If epsilon is chosen to be near the square root of the machine precision and the input vector elements are all roughly unit scale, and if the function has reasonable limits on variation, error should be on the order of epsilon^6.
The reference for the algorithm is:
Robert de Levie. 2009. An improved numerical approximation for the first derivative. Journal of Chemical Sciences 121(5), page 3.
Evaluating this function involves 6 calls to f for each dimension of the input.
| F | Type of function |
| [in] | f | Function |
| [in] | x | Argument to function |
| [out] | fx | Function applied to argument |
| [out] | grad_fx | Gradient of function at argument |
| [in] | epsilon | perturbation size |
Definition at line 43 of file finite_diff_gradient.hpp.
| void stan::math::finite_diff_gradient_auto | ( | const F & | f, |
| const Eigen::VectorXd & | x, | ||
| double & | fx, | ||
| Eigen::VectorXd & | grad_fx | ||
| ) |
Calculate the value and the gradient of the specified function at the specified argument using finite difference.
The functor must implement
double operator()(const Eigen::Matrix<double, -, 1>&) const;
Error of derivative in dimension i should be on the should be on order of epsilon(i)^6, where epsilon(i) = sqrt(delta) * abs(x(i)) for input x at dimension i.
The reference for this algorithm is:
Robert de Levie. 2009. An improved numerical approximation for the first derivative. Journal of Chemical Sciences 121(5), page 3.
The reference for automatically setting the difference is this section of the Wikipedia,
Numerical differentiation: practical considerations using floating point arithmetic.
Evaluating this function involves 6 calls to the function being differentiated for each dimension in the input, plus one global evaluation. All evaluations will be for double-precision inputs.
| F | Type of function |
| [in] | f | function |
| [in] | x | argument to function |
| [out] | fx | function applied to argument |
| [out] | grad_fx | gradient of function at argument |
Definition at line 50 of file finite_diff_gradient_auto.hpp.
|
inline |
Return the stepsize for finite difference evaluations at the specified scalar.
The formula used is stepsize(u) = cbrt(epsilon) * max(1, abs(u)).
| u | initial value to increment |
Definition at line 21 of file finite_diff_stepsize.hpp.
|
inline |
Return the floor of the specified variable (cmath).
The derivative of the floor function is defined and zero everywhere but at integers, so we set these derivatives to zero for convenience,
\(\frac{d}{dx} {\lfloor x \rfloor} = 0\).
The floor function rounds down. For double values, this is the largest integral value that is not greater than the specified value. Although this function is not differentiable because it is discontinuous at integral values, its gradient is returned as zero everywhere.
\[ \mbox{floor}(x) = \begin{cases} \lfloor x \rfloor & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{floor}(x)}{\partial x} = \begin{cases} 0 & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Input variable. |
|
inline |
|
inline |
|
inline |
Return the product of the first two arguments plus the third argument.
Warning: This does not delegate to the high-precision platform-specific fma() implementation.
| x | First argument. |
| y | Second argument. |
| z | Third argument. |
The fused multiply-add function for three variables (C99).
This function returns the product of the first two arguments plus the third argument.
The partial derivatives are
\(\frac{\partial}{\partial x} (x * y) + z = y\), and
\(\frac{\partial}{\partial y} (x * y) + z = x\), and
\(\frac{\partial}{\partial z} (x * y) + z = 1\).
| x | First multiplicand. |
| y | Second multiplicand. |
| z | Summand. |
|
inline |
|
inline |
The fused multiply-add function for two variables and a value (C99).
This function returns the product of the first two arguments plus the third argument.
The partial derivatives are
\(\frac{\partial}{\partial x} (x * y) + z = y\), and
\(\frac{\partial}{\partial y} (x * y) + z = x\).
| Tc | type of the summand |
| x | First multiplicand. |
| y | Second multiplicand. |
| z | Summand. |
|
inline |
The fused multiply-add operation (C99).
This double-based operation delegates to fma.
The function is defined by
fma(a, b, c) = (a * b) + c.
\[ \mbox{fma}(x, y, z) = \begin{cases} x\cdot y+z & \mbox{if } -\infty\leq x, y, z \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fma}(x, y, z)}{\partial x} = \begin{cases} y & \mbox{if } -\infty\leq x, y, z \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fma}(x, y, z)}{\partial y} = \begin{cases} x & \mbox{if } -\infty\leq x, y, z \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fma}(x, y, z)}{\partial z} = \begin{cases} 1 & \mbox{if } -\infty\leq x, y, z \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| x1 | First value. |
| x2 | Second value. |
| x3 | Third value. |
|
inline |
|
inline |
|
inline |
The fused multiply-add function for a variable, value, and variable (C99).
This function returns the product of the first two arguments plus the third argument.
The partial derivatives are
\(\frac{\partial}{\partial x} (x * y) + z = y\), and
\(\frac{\partial}{\partial z} (x * y) + z = 1\).
| Ta | type of the first multiplicand |
| Tb | type of the second multiplicand |
| Tc | type of the summand |
| x | First multiplicand. |
| y | Second multiplicand. |
| z | Summand. |
|
inline |
|
inline |
|
inline |
The fused multiply-add function for a variable and two values (C99).
This function returns the product of the first two arguments plus the third argument.
The double-based version ::fma(double, double, double) is defined in <cmath>.
The derivative is
\(\frac{d}{d x} (x * y) + z = y\).
| Tb | type of the second multiplicand |
| Tc | type of the summand |
| x | First multiplicand. |
| y | Second multiplicand. |
| z | Summand. |
|
inline |
|
inline |
|
inline |
The fused multiply-add function for a value, variable, and value (C99).
This function returns the product of the first two arguments plus the third argument.
The derivative is
\(\frac{d}{d y} (x * y) + z = x\), and
| Ta | type of the first multiplicand |
| Tc | type of the summand |
| x | First multiplicand. |
| y | Second multiplicand. |
| z | Summand. |
|
inline |
The fused multiply-add function for two values and a variable, and value (C99).
This function returns the product of the first two arguments plus the third argument.
The derivative is
\(\frac{\partial}{\partial z} (x * y) + z = 1\).
| Ta | type of the first multiplicand |
| Tb | type of the second multiplicand |
| x | First multiplicand. |
| y | Second multiplicand. |
| z | Summand. |
|
inline |
The fused multiply-add function for a value and two variables (C99).
This function returns the product of the first two arguments plus the third argument.
The partial derivatives are
\(\frac{\partial}{\partial y} (x * y) + z = x\), and
\(\frac{\partial}{\partial z} (x * y) + z = 1\).
| Ta | type of the first multiplicand |
| x | First multiplicand. |
| y | Second multiplicand. |
| z | Summand. |
|
inline |
The fused multiply-add function for three variables (C99).
This function returns the product of the first two arguments plus the third argument.
The partial derivatives are
\(\frac{\partial}{\partial x} (x * y) + z = y\), and
\(\frac{\partial}{\partial y} (x * y) + z = x\), and
\(\frac{\partial}{\partial z} (x * y) + z = 1\).
| x | First multiplicand. |
| y | Second multiplicand. |
| z | Summand. |
|
inline |
|
inline |
Enables the vectorised application of the fmax function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Returns the maximum of the two variable arguments (C99).
No new variable implementations are created, with this function defined as if by
fmax(a, b) = a if a's value is greater than b's, and .
fmax(a, b) = b if b's value is greater than or equal to a's.
\[ \mbox{fmax}(x, y) = \begin{cases} x & \mbox{if } x \geq y \\ y & \mbox{if } x < y \\[6pt] x & \mbox{if } -\infty\leq x\leq \infty, y = \textrm{NaN}\\ y & \mbox{if } -\infty\leq y\leq \infty, x = \textrm{NaN}\\ \textrm{NaN} & \mbox{if } x, y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fmax}(x, y)}{\partial x} = \begin{cases} 1 & \mbox{if } x \geq y \\ 0 & \mbox{if } x < y \\[6pt] 1 & \mbox{if } -\infty\leq x\leq \infty, y = \textrm{NaN}\\ 0 & \mbox{if } -\infty\leq y\leq \infty, x = \textrm{NaN}\\ \textrm{NaN} & \mbox{if } x, y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fmax}(x, y)}{\partial y} = \begin{cases} 0 & \mbox{if } x \geq y \\ 1 & \mbox{if } x < y \\[6pt] 0 & \mbox{if } -\infty\leq x\leq \infty, y = \textrm{NaN}\\ 1 & \mbox{if } -\infty\leq y\leq \infty, x = \textrm{NaN}\\ \textrm{NaN} & \mbox{if } x, y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Returns the maximum of the variable and scalar, promoting the scalar to a variable if it is larger (C99).
For fmax(a, b), if a's value is greater than b, then a is returned, otherwise a fresh variable implementation wrapping the value b is returned.
| a | First variable. |
| b | Second value |
Returns the maximum of a scalar and variable, promoting the scalar to a variable if it is larger (C99).
For fmax(a, b), if a is greater than b's value, then a fresh variable implementation wrapping a is returned, otherwise b is returned.
| a | First value. |
| b | Second variable. |
|
inline |
|
inline |
Enables the vectorised application of the fmin function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Returns the minimum of the two variable arguments (C99).
For fmin(a, b), if a's value is less than b's, then a is returned, otherwise b is returned.
\[ \mbox{fmin}(x, y) = \begin{cases} x & \mbox{if } x \leq y \\ y & \mbox{if } x > y \\[6pt] x & \mbox{if } -\infty\leq x\leq \infty, y = \textrm{NaN}\\ y & \mbox{if } -\infty\leq y\leq \infty, x = \textrm{NaN}\\ \textrm{NaN} & \mbox{if } x, y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fmin}(x, y)}{\partial x} = \begin{cases} 1 & \mbox{if } x \leq y \\ 0 & \mbox{if } x > y \\[6pt] 1 & \mbox{if } -\infty\leq x\leq \infty, y = \textrm{NaN}\\ 0 & \mbox{if } -\infty\leq y\leq \infty, x = \textrm{NaN}\\ \textrm{NaN} & \mbox{if } x, y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fmin}(x, y)}{\partial y} = \begin{cases} 0 & \mbox{if } x \leq y \\ 1 & \mbox{if } x > y \\[6pt] 0 & \mbox{if } -\infty\leq x\leq \infty, y = \textrm{NaN}\\ 1 & \mbox{if } -\infty\leq y\leq \infty, x = \textrm{NaN}\\ \textrm{NaN} & \mbox{if } x, y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Returns the minimum of the variable and scalar, promoting the scalar to a variable if it is larger (C99).
For fmin(a, b), if a's value is less than or equal to b, then a is returned, otherwise a fresh variable wrapping b is returned.
| a | First variable. |
| b | Second value |
Returns the minimum of a scalar and variable, promoting the scalar to a variable if it is larger (C99).
For fmin(a, b), if a is less than b's value, then a fresh variable implementation wrapping a is returned, otherwise b is returned.
| a | First value. |
| b | Second variable. |
|
inline |
Enables the vectorised application of the fmod function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
|
inline |
Return the floating point remainder after dividing the first variable by the second (cmath).
The partial derivatives with respect to the variables are defined everywhere but where \(x = y\), but we set these to match other values, with
\(\frac{\partial}{\partial x} \mbox{fmod}(x, y) = 1\), and
\(\frac{\partial}{\partial y} \mbox{fmod}(x, y) = -\lfloor \frac{x}{y} \rfloor\).
\[ \mbox{fmod}(x, y) = \begin{cases} x - \lfloor \frac{x}{y}\rfloor y & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fmod}(x, y)}{\partial x} = \begin{cases} 1 & \mbox{if } -\infty\leq x, y\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fmod}(x, y)}{\partial y} = \begin{cases} -\lfloor \frac{x}{y}\rfloor & \mbox{if } -\infty\leq x, y\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Return the floating point remainder after dividing the first variable by the second (cmath).
The partial derivatives with respect to the variables are defined everywhere but where \(x = y\), but we set these to match other values, with
\(\frac{\partial}{\partial x} \mbox{fmod}(x, y) = 1\), and
\(\frac{\partial}{\partial y} \mbox{fmod}(x, y) = -\lfloor \frac{x}{y} \rfloor\).
\[ \mbox{fmod}(x, y) = \begin{cases} x - \lfloor \frac{x}{y}\rfloor y & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fmod}(x, y)}{\partial x} = \begin{cases} 1 & \mbox{if } -\infty\leq x, y\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{fmod}(x, y)}{\partial y} = \begin{cases} -\lfloor \frac{x}{y}\rfloor & \mbox{if } -\infty\leq x, y\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Return the floating point remainder after dividing the the first variable by the second scalar (cmath).
The derivative with respect to the variable is
\(\frac{d}{d x} \mbox{fmod}(x, c) = \frac{1}{c}\).
| a | First variable. |
| b | Second scalar. |
Return the floating point remainder after dividing the first scalar by the second variable (cmath).
The derivative with respect to the variable is
\(\frac{d}{d y} \mbox{fmod}(c, y) = -\lfloor \frac{c}{y} \rfloor\).
| a | First scalar. |
| b | Second variable. |
|
inline |
Apply a function to each element of a tuple.
| F | type with a valid operator() |
| T | Tuple |
| f | A functor to apply over each element of the tuple. |
| t | A tuple |
Definition at line 66 of file for_each.hpp.
|
inline |
Apply a function to each element of two tuples.
| F | type with a valid operator() |
| T1 | Tuple |
| T2 | Another tuple |
| f | A functor to apply over each element of the tuple. |
| t1 | A tuple |
| t2 | Another tuple |
Definition at line 82 of file for_each.hpp.
|
inline |
Apply a function to each element of three tuples.
| F | type with a valid operator() |
| T1 | Tuple |
| T2 | Another tuple |
| T3 | Another tuple |
| f | A functor to apply over each element of the tuple. |
| t1 | A tuple |
| t2 | Another tuple |
| t3 | Another tuple |
Definition at line 104 of file for_each.hpp.
|
inline |
Assume which type we get.
If actual type is not convertible to assumed type or in case of eigen types compile time rows and columns are not the same and desired sizes are not dynamic this has return type of T_desired, but it only throws. This version should only be used where it is optimized away so the throw should never happen.
This is intended to be used in compile time branches that would otherwise trigger compile error even though they are never executed.
| T_desired | type of output we need to avoid compile time errors |
| T_actual | actual type of the argument |
| a | input value |
| always | throws std::runtime_error |
Definition at line 122 of file forward_as.hpp.
| return_type_t<T_y, T_shape, T_scale> stan::math::frechet_cdf | ( | const T_y & | y, |
| const T_shape & | alpha, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 28 of file frechet_cdf.hpp.
| return_type_t<T_y, T_shape, T_scale> stan::math::frechet_lccdf | ( | const T_y & | y, |
| const T_shape & | alpha, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 28 of file frechet_lccdf.hpp.
| return_type_t<T_y, T_shape, T_scale> stan::math::frechet_lcdf | ( | const T_y & | y, |
| const T_shape & | alpha, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 26 of file frechet_lcdf.hpp.
| return_type_t<T_y, T_shape, T_scale> stan::math::frechet_lpdf | ( | const T_y & | y, |
| const T_shape & | alpha, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 31 of file frechet_lpdf.hpp.
|
inline |
Definition at line 101 of file frechet_lpdf.hpp.
| Eigen::Matrix<var, T::RowsAtCompileTime, T::ColsAtCompileTime> stan::math::from_var_value | ( | const T & | a | ) |
Converts var_value into an Eigen Matrix.
Adjoint is propagated back to argument in the reverse pass.
| T | type of the input |
| a | matrix to convert |
Definition at line 20 of file from_var_value.hpp.
| T stan::math::from_var_value | ( | T && | a | ) |
This is a no-op for Eigen containers of vars, scalars or prim types.
| T | type of the input |
| a | matrix to convert |
Definition at line 40 of file from_var_value.hpp.
| auto stan::math::from_var_value | ( | const std::vector< T > & | a | ) |
Convert the elements of the std::vector input to var_value types if possible.
| T | type of elemnts of the input vector |
| a | std::vector of elements to convert |
Definition at line 52 of file from_var_value.hpp.
| return_type_t<T_y, T_shape, T_inv_scale> stan::math::gamma_lccdf | ( | const T_y & | y, |
| const T_shape & | alpha, | ||
| const T_inv_scale & | beta | ||
| ) |
Definition at line 25 of file gamma_lccdf.hpp.
| return_type_t<T_y, T_shape, T_inv_scale> stan::math::gamma_lcdf | ( | const T_y & | y, |
| const T_shape & | alpha, | ||
| const T_inv_scale & | beta | ||
| ) |
Definition at line 25 of file gamma_lcdf.hpp.
|
inline |
Definition at line 123 of file gamma_lpdf.hpp.
|
inline |
Definition at line 16 of file gamma_p.hpp.
Definition at line 35 of file gamma_p.hpp.
Definition at line 50 of file gamma_p.hpp.
|
inline |
Return the value of the normalized, lower-incomplete gamma function applied to the specified argument.
This function is defined, including error conditions, as follows
\[ \mbox{gamma\_p}(a, z) = \begin{cases} \textrm{error} & \mbox{if } a\leq 0 \textrm{ or } z < 0\\ P(a, z) & \mbox{if } a > 0, z \geq 0 \\[6pt] \textrm{NaN} & \mbox{if } a = \textrm{NaN or } z = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{gamma\_p}(a, z)}{\partial a} = \begin{cases} \textrm{error} & \mbox{if } a\leq 0 \textrm{ or } z < 0\\ \frac{\partial\, P(a, z)}{\partial a} & \mbox{if } a > 0, z \geq 0 \\[6pt] \textrm{NaN} & \mbox{if } a = \textrm{NaN or } z = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{gamma\_p}(a, z)}{\partial z} = \begin{cases} \textrm{error} & \mbox{if } a\leq 0 \textrm{ or } z < 0\\ \frac{\partial\, P(a, z)}{\partial z} & \mbox{if } a > 0, z \geq 0 \\[6pt] \textrm{NaN} & \mbox{if } a = \textrm{NaN or } z = \textrm{NaN} \end{cases} \]
\[ P(a, z)=\frac{1}{\Gamma(a)}\int_0^zt^{a-1}e^{-t}dt \]
\[ \frac{\partial \, P(a, z)}{\partial a} = -\frac{\Psi(a)}{\Gamma^2(a)}\int_0^zt^{a-1}e^{-t}dt + \frac{1}{\Gamma(a)}\int_0^z (a-1)t^{a-2}e^{-t}dt \]
\[ \frac{\partial \, P(a, z)}{\partial z} = \frac{z^{a-1}e^{-z}}{\Gamma(a)} \]
| z | first argument |
| a | second argument |
| std::domain_error | if either argument is not positive or if z is at a pole of the function |
Definition at line 67 of file gamma_p.hpp.
|
inline |
Enables the vectorised application of the gamma_p function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 90 of file gamma_p.hpp.
Definition at line 102 of file gamma_p.hpp.
Definition at line 106 of file gamma_p.hpp.
Definition at line 110 of file gamma_p.hpp.
|
inline |
Definition at line 14 of file gamma_q.hpp.
Definition at line 46 of file gamma_q.hpp.
Definition at line 50 of file gamma_q.hpp.
Definition at line 54 of file gamma_q.hpp.
|
inline |
\[ \mbox{gamma\_q}(a, z) = \begin{cases} \textrm{error} & \mbox{if } a\leq 0 \textrm{ or } z < 0\\ Q(a, z) & \mbox{if } a > 0, z \geq 0 \\[6pt] \textrm{NaN} & \mbox{if } a = \textrm{NaN or } z = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{gamma\_q}(a, z)}{\partial a} = \begin{cases} \textrm{error} & \mbox{if } a\leq 0 \textrm{ or } z < 0\\ \frac{\partial\, Q(a, z)}{\partial a} & \mbox{if } a > 0, z \geq 0 \\[6pt] \textrm{NaN} & \mbox{if } a = \textrm{NaN or } z = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{gamma\_q}(a, z)}{\partial z} = \begin{cases} \textrm{error} & \mbox{if } a\leq 0 \textrm{ or } z < 0\\ \frac{\partial\, Q(a, z)}{\partial z} & \mbox{if } a > 0, z \geq 0 \\[6pt] \textrm{NaN} & \mbox{if } a = \textrm{NaN or } z = \textrm{NaN} \end{cases} \]
\[ Q(a, z)=\frac{1}{\Gamma(a)}\int_z^\infty t^{a-1}e^{-t}dt \]
\[ \frac{\partial \, Q(a, z)}{\partial a} = -\frac{\Psi(a)}{\Gamma^2(a)}\int_z^\infty t^{a-1}e^{-t}dt + \frac{1}{\Gamma(a)}\int_z^\infty (a-1)t^{a-2}e^{-t}dt \]
\[ \frac{\partial \, Q(a, z)}{\partial z} = -\frac{z^{a-1}e^{-z}}{\Gamma(a)} \]
| domain_error | if x is at pole |
Definition at line 55 of file gamma_q.hpp.
Definition at line 58 of file gamma_q.hpp.
|
inline |
Enables the vectorised application of the gamma_q function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 68 of file gamma_q.hpp.
Definition at line 77 of file gamma_q.hpp.
|
inline |
Definition at line 288 of file gaussian_dlm_obs_lpdf.hpp.
|
inline |
Definition at line 142 of file gaussian_dlm_obs_rng.hpp.
|
inline |
Returns the Moore-Penrose generalized inverse of the specified matrix.
The method is based on the Cholesky computation of the transform as specified in
| EigMat | type of the matrix (must be derived from Eigen::MatrixBase) |
| G | specified matrix |
Definition at line 33 of file generalized_inverse.hpp.
|
inline |
Definition at line 64 of file generalized_inverse.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one index.
If the index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i | Index into vector plus 1. |
| error_msg | Error message if the index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
i - 1 | std::out_of_range | if idx is out of range. |
Definition at line 28 of file get_base1.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 51 of file get_base1.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 75 of file get_base1.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| i4 | Fourth index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 101 of file get_base1.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| i4 | Fourth index plus 1. |
| i5 | Fifth index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 129 of file get_base1.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| i4 | Fourth index plus 1. |
| i5 | Fifth index plus 1. |
| i6 | Sixth index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 159 of file get_base1.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| i4 | Fourth index plus 1. |
| i5 | Fifth index plus 1. |
| i6 | Sixth index plus 1. |
| i7 | Seventh index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 190 of file get_base1.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| i4 | Fourth index plus 1. |
| i5 | Fifth index plus 1. |
| i6 | Sixth index plus 1. |
| i7 | Seventh index plus 1. |
| i8 | Eigth index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 222 of file get_base1.hpp.
|
inline |
Return a copy of the row of the specified matrix at the specified base-one row index.
If the index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
Warning: Because a copy is involved, it is inefficient to access element of matrices by first using this method to get a row then using a second call to get the value at a specified column.
| EigMat | type of the matrix |
| x | Matrix from which to get a row |
| m | Index into matrix plus 1. |
| error_msg | Error message if the index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
i - 1. | std::out_of_range | if idx is out of range. |
Definition at line 253 of file get_base1.hpp.
|
inline |
Return a reference to the value of the specified matrix at the specified base-one row and column indexes.
If either index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| EigMat | type of the matrix |
| x | Matrix from which to get a row |
| m | Row index plus 1. |
| n | Column index plus 1. |
| error_msg | Error message if either index is out of range. |
| idx | Nested index level to report in error message if either index is out of range. |
m - 1 and column n - 1. | std::out_of_range | if idx is out of range. |
Definition at line 277 of file get_base1.hpp.
|
inline |
Return a reference to the value of the specified Eigen vector at the specified base-one index.
If the index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| EigVec | type of the vector |
| x | Eigen vector from which to get a value. |
| m | Row index plus 1. |
| error_msg | Error message if the index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
m - 1. | std::out_of_range | if idx is out of range. |
Definition at line 301 of file get_base1.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one index.
If the index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i | Index into vector plus 1. |
| error_msg | Error message if the index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
i - 1 | std::out_of_range | if idx is out of range. |
Definition at line 27 of file get_base1_lhs.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 50 of file get_base1_lhs.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 74 of file get_base1_lhs.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| i4 | Fourth index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 100 of file get_base1_lhs.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| i4 | Fourth index plus 1. |
| i5 | Fifth index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 127 of file get_base1_lhs.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| i4 | Fourth index plus 1. |
| i5 | Fifth index plus 1. |
| i6 | Sixth index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 156 of file get_base1_lhs.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| i4 | Fourth index plus 1. |
| i5 | Fifth index plus 1. |
| i6 | Sixth index plus 1. |
| i7 | Seventh index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 187 of file get_base1_lhs.hpp.
|
inline |
Return a reference to the value of the specified vector at the specified base-one indexes.
If an index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Vector from which to get a value. |
| i1 | First index plus 1. |
| i2 | Second index plus 1. |
| i3 | Third index plus 1. |
| i4 | Fourth index plus 1. |
| i5 | Fifth index plus 1. |
| i6 | Sixth index plus 1. |
| i7 | Seventh index plus 1. |
| i8 | Eigth index plus 1. |
| error_msg | Error message if an index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
| std::out_of_range | if idx is out of range. |
Definition at line 219 of file get_base1_lhs.hpp.
|
inline |
Return a copy of the row of the specified vector at the specified base-one row index.
If the index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
Warning: Because a copy is involved, it is inefficient to access element of matrices by first using this method to get a row then using a second call to get the value at a specified column.
| T | type of value |
| x | Matrix from which to get a row |
| m | Index into matrix plus 1. |
| error_msg | Error message if the index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
i - 1. | std::out_of_range | if idx is out of range. |
Definition at line 251 of file get_base1_lhs.hpp.
|
inline |
Return a reference to the value of the specified matrix at the specified base-one row and column indexes.
If either index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Matrix from which to get a row |
| m | Row index plus 1. |
| n | Column index plus 1. |
| error_msg | Error message if either index is out of range. |
| idx | Nested index level to report in error message if either index is out of range. |
m - 1 and column n - 1. | std::out_of_range | if idx is out of range. |
Definition at line 275 of file get_base1_lhs.hpp.
|
inline |
Return a reference to the value of the specified column vector at the specified base-one index.
If the index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Column vector from which to get a value. |
| m | Row index plus 1. |
| error_msg | Error message if the index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
m - 1. | std::out_of_range | if idx is out of range. |
Definition at line 298 of file get_base1_lhs.hpp.
|
inline |
Return a reference to the value of the specified row vector at the specified base-one index.
If the index is out of range, throw a std::out_of_range exception with the specified error message and index indicated.
| T | type of value |
| x | Row vector from which to get a value. |
| n | Column index plus 1. |
| error_msg | Error message if the index is out of range. |
| idx | Nested index level to report in error message if the index is out of range. |
n - 1. | std::out_of_range | if idx is out of range. |
Definition at line 320 of file get_base1_lhs.hpp.
| T stan::math::get_imag | ( | const std::complex< T > & | z | ) |
Return the imaginary component of the complex argument.
| T | value type of complex argument |
| [in] | z | complex value whose imaginary component is extracted |
Definition at line 18 of file get_imag.hpp.
|
inline |
Definition at line 10 of file get_lp.hpp.
| T stan::math::get_real | ( | const std::complex< T > & | z | ) |
Return the real component of the complex argument.
| T | value type of complex argument |
| [in] | z | complex value whose real component is extracted |
Definition at line 18 of file get_real.hpp.
| Eigen::Matrix<return_type_t<T_x, T_sigma>, Eigen::Dynamic, Eigen::Dynamic> stan::math::gp_dot_prod_cov | ( | const std::vector< Eigen::Matrix< T_x, Eigen::Dynamic, 1 >> & | x, |
| const T_sigma & | sigma | ||
| ) |
Returns a dot product covariance matrix.
A member of Stan's Gaussian Process Library.
\(k(x,x') = \sigma^2 + x \cdot x'\)
A dot product covariance matrix is the same covariance matrix as in bayesian regression with \(N(0,1)\) priors on regression coefficients and a \(N(0,\sigma^2)\) prior on the constant function. See Rasmussen and Williams et al 2006, Chapter 4.
| T_x | type of std::vector of elements |
| T_sigma | type of sigma |
| x | std::vector of elements that can be used in dot product. This function assumes each element of x is the same size. |
| sigma | constant function that can be used in stan::math::square |
| std::domain_error | if sigma < 0, nan, inf or x is nan or infinite |
Definition at line 38 of file gp_dot_prod_cov.hpp.
| Eigen::Matrix<return_type_t<T_x, T_sigma>, Eigen::Dynamic, Eigen::Dynamic> stan::math::gp_dot_prod_cov | ( | const std::vector< T_x > & | x, |
| const T_sigma & | sigma | ||
| ) |
Returns a dot product covariance matrix.
A member of Stan's Gaussian Process Library.
\(k(x,x') = \sigma^2 + x \cdot x'\)
A dot product covariance matrix is the same covariance matrix as in bayesian regression with \(N(0,1)\) priors on regression coefficients and a \(N(0,\sigma^2)\) prior on the constant function. See Rasmussen and Williams et al 2006, Chapter 4.
| T_x | type of std::vector of double |
| T_sigma | type of sigma |
| x | std::vector of elements that can be used in transpose and multiply This function assumes each element of x is the same size. |
| sigma | constant function that can be used in stan::math::square |
| std::domain_error | if sigma < 0, nan, inf or x is nan or infinite |
Definition at line 100 of file gp_dot_prod_cov.hpp.
| Eigen::Matrix<return_type_t<T_x1, T_x2, T_sigma>, Eigen::Dynamic, Eigen::Dynamic> stan::math::gp_dot_prod_cov | ( | const std::vector< Eigen::Matrix< T_x1, Eigen::Dynamic, 1 >> & | x1, |
| const std::vector< Eigen::Matrix< T_x2, Eigen::Dynamic, 1 >> & | x2, | ||
| const T_sigma & | sigma | ||
| ) |
Returns a dot product covariance matrix of differing x's.
A member of Stan's Gaussian Process Library.
\(k(x,x') = \sigma^2 + x \cdot x'\)
A dot product covariance matrix is the same covariance matrix as in bayesian regression with \(N(0,1)\) priors on regression coefficients and a \(N(0,\sigma^2)\) prior on the constant function. See Rasmussen and Williams et al 2006, Chapter 4.
| T_x1 | type of first std::vector of elements |
| T_x2 | type of second std::vector of elements |
| T_sigma | type of sigma |
| x1 | std::vector of elements that can be used in dot_product |
| x2 | std::vector of elements that can be used in dot_product |
| sigma | constant function that can be used in stan::math::square |
| std::domain_error | if sigma < 0, nan or inf or if x1 or x2 are nan or inf |
Definition at line 157 of file gp_dot_prod_cov.hpp.
| Eigen::Matrix<return_type_t<T_x1, T_x2, T_sigma>, Eigen::Dynamic, Eigen::Dynamic> stan::math::gp_dot_prod_cov | ( | const std::vector< T_x1 > & | x1, |
| const std::vector< T_x2 > & | x2, | ||
| const T_sigma & | sigma | ||
| ) |
Returns a dot product covariance matrix of differing x's.
A member of Stan's Gaussian Process Library.
\(k(x,x') = \sigma^2 + x \cdot x'\)
A dot product covariance matrix is the same covariance matrix as in bayesian regression with \(N(0,1)\) priors on regression coefficients and a \(N(0,\sigma^2)\) prior on the constant function. See Rasmussen and Williams et al 2006, Chapter 4.
| T_x1 | type of first std::vector of double |
| T_x2 | type of second std::vector of double |
| T_sigma | type of sigma |
| x1 | std::vector of elements that can be used in dot_product |
| x2 | std::vector of elements that can be used in dot_product |
| sigma | is the constant function that can be used in stan::math::square |
| std::domain_error | if sigma < 0, nan or inf or if x1 or x2 are nan or inf |
Definition at line 221 of file gp_dot_prod_cov.hpp.
|
inline |
Returns a squared exponential kernel.
| T_x | type of elements in the vector |
| x | std::vector input that can be used in square distance Assumes each element of x is the same size |
| sigma | standard deviation |
| length_scale | length scale |
| std::domain_error | if sigma <= 0, l <= 0, or x is nan or infinite |
Definition at line 33 of file gp_exp_quad_cov.hpp.
|
inline |
Returns a squared exponential kernel.
| T_x | type for each scalar |
| T_sigma | type of parameter sigma |
| T_l | type of parameter length scale |
| x | std::vector of scalars that can be used in square distance. This function assumes each element of x is the same size. |
| sigma | marginal standard deviation or magnitude |
| length_scale | length scale |
| std::domain_error | if sigma <= 0, l <= 0, or x is nan or infinite |
Definition at line 126 of file gp_exp_quad_cov.hpp.
|
inline |
Returns a squared exponential kernel.
| T_x | type for each scalar |
| T_sigma | type of parameter sigma |
| T_l | type of each length scale parameter |
| x | std::vector of Eigen vectors of scalars. |
| sigma | marginal standard deviation or magnitude |
| length_scale | std::vector length scale |
| std::domain_error | if sigma <= 0, l <= 0, or x is nan or infinite |
Definition at line 166 of file gp_exp_quad_cov.hpp.
|
inline |
Returns a squared exponential kernel.
This function is for the cross covariance matrix needed to compute posterior predictive density.
| T_x1 | type of first std::vector of scalars |
| T_x2 | type of second std::vector of scalars This function assumes each element of x1 and x2 are the same size. |
| T_sigma | type of sigma |
| T_l | type of of length scale |
| x1 | std::vector of elements that can be used in square distance |
| x2 | std::vector of elements that can be used in square distance |
| sigma | standard deviation |
| length_scale | length scale |
| std::domain_error | if sigma <= 0, l <= 0, or x is nan or infinite |
Definition at line 209 of file gp_exp_quad_cov.hpp.
|
inline |
Returns a squared exponential kernel.
This function is for the cross covariance matrix needed to compute the posterior predictive density.
| T_x1 | type of first std::vector of elements |
| T_x2 | type of second std::vector of elements |
| T_s | type of sigma |
| T_l | type of length scale |
| x1 | std::vector of Eigen vectors of scalars. |
| x2 | std::vector of Eigen vectors of scalars. |
| sigma | standard deviation |
| length_scale | std::vector of length scale |
| std::domain_error | if sigma <= 0, l <= 0, or x is nan or infinite |
Definition at line 258 of file gp_exp_quad_cov.hpp.
|
inline |
Returns a Matern exponential covariance Matrix.
\[ k(x, x') = \sigma^2 exp(-\frac{d(x, x')^2}{2l^2}) \]
where d(x, x') is the Euclidean distance.
| T_x | type for each scalar |
| T_s | type of parameter sigma |
| T_l | type of parameter length scale |
| x | std::vector of scalars that can be used in stan::math::distance |
| sigma | standard deviation or magnitude |
| length_scale | length scale |
| std::domain | error if sigma <= 0, l <= 0, or x is nan or inf |
Definition at line 38 of file gp_exponential_cov.hpp.
|
inline |
Returns a Matern exponential covariance matrix.
\[ k(x, x') = \sigma^2 exp(-\sum_{k=1}^K\frac{d(x, x')}{l_k}) \]
where d(x, x') is the Euclidean distance.
| T_x | type for each scalar |
| T_s | type for each parameter sigma |
| T_l | type for each length scale parameter |
| x | std::vector of Eigen::vectors of scalars |
| sigma | standard deviation that can be used in stan::math::square |
| length_scale | std::vector of length scales |
| std::domain | error if sigma <= 0, l <= 0, or x is nan or inf |
Definition at line 103 of file gp_exponential_cov.hpp.
|
inline |
Returns a Matern exponential cross covariance matrix.
\[ k(x, x') = \sigma^2 exp(-\frac{d(x, x')}{l}) \]
where d(x, x') is the Euclidean distance This function is for the cross covariance matrix needed to compute the posterior predictive distribution
| T_x1 | first type of scalars contained in vector x1 |
| T_x2 | second type of scalars contained in vector x2 |
| T_s | type of parameter sigma, marginal standard deviation |
| T_l | type of parameter length scale |
| x1 | std::vector of scalars that can be used in squared_distance |
| x2 | std::vector of scalars that can be used in squared_distance |
| length_scale | length scale |
| sigma | standard deviation that can be used in stan::math::square |
| std::domain | error if sigma <= 0, l <= 0, or x1, x2 are nan or inf |
Definition at line 171 of file gp_exponential_cov.hpp.
|
inline |
Returns a Matern exponential cross covariance matrix.
\[ k(x, x') = \sigma^2 exp(-\sum_{k=1}^K\frac{d(x, x')}{l_k}) \]
where \(d(x, x')\) is the Euclidean distance
This function is for the cross covariance matrix needed to compute the posterior predictive density.
| T_x1 | first type of std::vector of scalars |
| T_x2 | second type of std::vector of scalars |
| T_s | type of parameter sigma, marginal standard deviation |
| T_l | type of parameter length scale |
| x1 | std::vector of Eigen vectors of scalars |
| x2 | std::vector of Eigen vectors of scalars |
| length_scale | parameter length scale |
| sigma | standard deviation that can be used in stan::math::square |
| std::domain | error if sigma <= 0, l <= 0, or x1, x2 are nan or inf |
Definition at line 248 of file gp_exponential_cov.hpp.
|
inline |
Returns a Matern 3/2 covariance matrix.
\[ k(x, x') = \sigma^2(1 + \frac{\sqrt{3}d(x, x')}{l})exp(-\frac{\sqrt{3}d(x, x')}{l}) \]
where \( d(x, x') \) is the Euclidean distance.
| T_x | type for each scalar |
| T_s | type of parameter of sigma |
| T_l | type of parameter length scale |
| x | std::vector of scalars that can be used in squared distance |
| length_scale | length scale |
| sigma | marginal standard deviation or magnitude |
| std::domain | error if sigma <= 0, l <= 0, or x is nan or inf |
Definition at line 39 of file gp_matern32_cov.hpp.
|
inline |
Returns a Matern 3/2 covariance matrix.
\[ k(x, x') = \sigma^2(1 + \sqrt{3} \sqrt{\sum_{k=1}^{K}\frac{d(x, x')^2}{l_k^2}}) exp(-\sqrt{3}\sqrt{\sum_{k=1}^{K}\frac{d(x, x')^2}{l_k^2}}) \]
where \(d(x, x')\) is the Euclidean distance.
| T_x | type for each scalar |
| T_s | type of element of parameter sigma |
| T_l | type of each length scale parameter |
| x | std::vector of Eigen vectors of scalars. |
| length_scale | std::vector of length scales |
| sigma | standard deviation that can be used in stan::math::square |
| std::domain | error if sigma <= 0, l <= 0, or x is nan or inf |
Definition at line 109 of file gp_matern32_cov.hpp.
|
inline |
Returns a Matern 3/2 cross covariance matrix.
\[ k(x, x') = \sigma^2(1 + \frac{\sqrt{3}d(x, x')}{l})exp(-\sqrt{3}\frac{d(x, x')}{l}) \]
where \(d(x, x')\) is the Euclidean distance.
This function is for the cross covariance matrix needed to compute the posterior predictive density.
| T_x1 | first type of scalars contained in vector x1 |
| T_x2 | second type of scalars contained in vector x2 |
| T_s | type of parameter sigma, marginal standard deviation |
| T_l | type of parameter length scale |
| x1 | std::vector of scalars that can be used in squared_distance |
| x2 | std::vector of scalars that can be used in squared_distance |
| length_scale | length scale |
| sigma | standard deviation that can be used in stan::math::square |
| std::domain | error if sigma <= 0, l <= 0, or x1, x2 are nan or inf |
Definition at line 186 of file gp_matern32_cov.hpp.
|
inline |
Returns a Matern 3/2 cross covariance matrix.
\[ k(x, x') = \sigma^2(1 + \sqrt{3} \sqrt{\sum_{k=1}^{K}\frac{d(x, x')^2}{l_k^2}}) exp(-\sqrt{3}\sqrt{\sum_{k=1}^{K}\frac{d(x, x')^2}{l_k^2}}) \]
where \(d(x, x')\) is the Euclidean distance
This function is for the cross covariance matrix needed to compute the posterior predictive density.
| T_x1 | first type of std::vector of scalars |
| T_x2 | second type of std::vector of scalars |
| T_s | type of parameter sigma, marginal standard deviation |
| T_l | type of parameter length scale |
| x1 | std::vector of Eigen vectors of scalars |
| x2 | std::vector of Eigen vectors of scalars |
| length_scale | parameter length scale |
| sigma | standard deviation that can be used in stan::math::square |
| std::domain | error if sigma <= 0, l <= 0, or x1, x2 are nan or inf |
Definition at line 268 of file gp_matern32_cov.hpp.
|
inline |
Returns a Matern 5/2 covariance matrix with one input vector.
\[ k(x, x') = \sigma^2\bigg(1 + \frac{\sqrt{5}d(x, x')}{l} + \frac{5d(x, x')^2}{3l^2}\bigg) exp\bigg(-\frac{5 d(x, x')}{l}\bigg) \]
where \( d(x, x') \) is the Euclidean distance.
| T_x | type of elements contained in vector x |
| T_s | type of element of sigma, the magnitude |
| T_l | type of elements of length scale |
| x | std::vector of elements that can be used in stan::math::distance |
| length_scale | length scale |
| sigma | standard deviation that can be used in stan::math::square |
| std::domain | error if sigma <= 0, l <= 0, or x is nan or inf |
Definition at line 41 of file gp_matern52_cov.hpp.
|
inline |
Returns a Matern 5/2 covariance matrix with one input vector with automatic relevance determination (ARD).
\[ k(x, x') = \sigma^2\bigg(1 + \sqrt{5}\sqrt{\sum_{k=1}^{K}\frac{d(x, x')^2}{l_k^2}} + \frac{5}{3} \sqrt{\sum_{k=1}^{K}\frac{d(x, x')^2}{l_k^2}}\bigg) exp\bigg(-\frac{5}{3}\bigg(\sqrt{\sum_{k=1}^K{\frac{d(x, x')^2}{l_k^2}} }\bigg)\bigg) \]
where \( d(x, x') \) is the Euclidean distance.
| T_x | type of elements contained in vector x |
| T_s | type of element of sigma, the magnitude |
| T_l | type of elements in vector of length scale |
| x | std::vector of elements that can be used in stan::math::distance |
| length_scale | length scale |
| sigma | standard deviation that can be used in stan::math::square |
| std::domain | error if sigma <= 0, l <= 0, or x is nan or inf |
| std::invalid_argument | if length scale size != dimension of x |
Definition at line 112 of file gp_matern52_cov.hpp.
|
inline |
Returns a Matern 5/2 covariance matrix with two different input vectors.
\[ k(x, x') = \sigma^2\bigg(1 + \frac{\sqrt{5}d(x, x')}{l} + \frac{5d(x, x')^2}{3l^2}\bigg) exp\bigg(-\frac{5 d(x, x')}{l}\bigg) \]
where \( d(x, x') \) is the Euclidean distance.
| T_x1 | type of elements contained in vector x1 |
| T_x2 | type of elements contained in vector x2 |
| T_s | type of element of sigma, the magnitude |
| T_l | type of elements of length scale |
| x1 | std::vector of elements that can be used in stan::math::distance |
| x2 | std::vector of elements that can be used in stan::math::distance |
| length_scale | length scale |
| sigma | standard deviation that can be used in stan::math::square |
| std::domain | error if sigma <= 0, l <= 0, or x is nan or inf |
Definition at line 188 of file gp_matern52_cov.hpp.
|
inline |
Returns a Matern 5/2 covariance matrix with two input vectors with automatic relevance determination (ARD).
\[ k(x, x') = \sigma^2\bigg(1 + \sqrt{5}\sqrt{\sum_{k=1}^{K}\frac{d(x, x')^2}{l_k^2}} + \frac{5}{3} \sqrt{\sum_{k=1}^{K}\frac{d(x, x')^2}{l_k^2}}\bigg) exp\bigg(-\frac{5}{3}\bigg(\sqrt{\sum_{k=1}^K{\frac{d(x, x')^2}{l_k^2}} }\bigg)\bigg) \]
where \( d(x, x') \) is the Euclidean distance.
| T_x1 | type of elements contained in vector x1 |
| T_x2 | type of elements contained in vector x2 |
| T_s | type of element of sigma, the magnitude |
| T_l | type of elements in vector of length scale |
| x1 | std::vector of elements that can be used in stan::math::distance |
| x2 | std::vector of elements that can be used in stan::math::distance |
| length_scale | length scale |
| sigma | standard deviation that can be used in stan::math::square |
| std::domain | error if sigma <= 0, l <= 0, or x is nan or inf |
| std::invalid_argument | if length scale size != dimension of x1 or x2 |
Definition at line 270 of file gp_matern52_cov.hpp.
|
inline |
Returns a periodic covariance matrix \( \mathbf{K} \) using the input \( \mathbf{X} \).
The elements of \( \mathbf{K} \) are defined as \( \mathbf{K}_{ij} = k(\mathbf{X}_i,\mathbf{X}_j), \) where \( \mathbf{X}_i \) is the \(i\)-th row of \( \mathbf{X} \) and
\( k(\mathbf{x},\mathbf{x}^\prime) = \sigma^2 \exp\left(-\frac{2\sin^2(\pi |\mathbf{x}-\mathbf{x}^\prime|/p)}{\ell^2}\right), \)
where \( \sigma^2 \), \( \ell \) and \( p \) are the signal variance, length-scale and period.
| T_x | type of elements in the std::vector |
| x | std::vector of input elements. Assumes that all elements of x have the same size. |
| sigma | standard deviation of the signal |
| l | length-scale |
| p | period |
| std::domain_error | if sigma <= 0, l <= 0, p <= 0, or x is nan or infinite |
Definition at line 42 of file gp_periodic_cov.hpp.
|
inline |
Returns a periodic covariance matrix \( \mathbf{K} \) using the input \( \mathbf{X} \).
The elements of \( \mathbf{K} \) are defined as \( \mathbf{K}_{ij} = k(\mathbf{X}_i,\mathbf{X}_j), \) where \( \mathbf{X}_i \) is the \(i\)-th row of \( \mathbf{X} \) and
\( k(\mathbf{x},\mathbf{x}^\prime) = \sigma^2 \exp\left(-\frac{2\sin^2(\pi |\mathbf{x}-\mathbf{x}^\prime|/p)}{\ell^2}\right), \)
where \( \sigma^2 \), \( \ell \) and \( p \) are the signal variance, length-scale and period.
| T_x | type of std::vector elements of x. T_x can be a scalar, an Eigen::Vector, or an Eigen::RowVector. |
| T_sigma | type of sigma |
| T_l | type of length-scale |
| T_p | type of period |
| x | std::vector of input elements. This function assumes that all elements of x have the same size. |
| sigma | standard deviation of the signal |
| l | length-scale |
| p | period |
| std::domain_error | if sigma <= 0, l <= 0, p <= 0 or x is nan or infinite |
Definition at line 47 of file gp_periodic_cov.hpp.
|
inline |
Returns a periodic covariance matrix \( \mathbf{K} \) using inputs \( \mathbf{X}_1 \) and \( \mathbf{X}_2 \).
The elements of \( \mathbf{K} \) are defined as \( \mathbf{K}_{ij} = k(\mathbf{X}_{1_i},\mathbf{X}_{2_j}), \) where \( \mathbf{X}_{1_i} \) and \( \mathbf{X}_{2_j} \) are the \(i\)-th and \(j\)-th rows of \( \mathbf{X}_1 \) and \( \mathbf{X}_2 \) and
\( k(\mathbf{x},\mathbf{x}^\prime) = \sigma^2 \exp\left(-\frac{2\sin^2(\pi |\mathbf{x}-\mathbf{x}^\prime|/p)}{\ell^2}\right), \)
where \( \sigma^2 \), \( \ell \) and \( p \) are the signal variance, length-scale and period.
| T_x1 | type of std::vector elements of x1 T_x1 can be a scalar, an Eigen::Vector, or an Eigen::RowVector. |
| T_x2 | type of std::vector elements of x2 T_x2 can be a scalar, an Eigen::Vector, or an Eigen::RowVector. |
| T_sigma | type of sigma |
| T_l | type of length-scale |
| T_p | type of period |
| x1 | std::vector of first input elements |
| x2 | std::vector of second input elements. This function assumes that all the elements of x1 and x2 have the same sizes. |
| sigma | standard deviation of the signal |
| l | length-scale |
| p | period |
| std::domain_error | if sigma <= 0, l <= 0, p <= 0 , x1 or x2 is nan or infinite |
Definition at line 127 of file gp_periodic_cov.hpp.
|
static |
|
inline |
Propagate chain rule to calculate gradients starting from the specified variable.
Resizes the input vector to be the correct size.
The grad() function does not itself recover any memory. use recover_memory() or recover_memory_nested() to recover memory.
| [in] | v | Value of function being differentiated |
| [in] | x | Variables being differentiated with respect to |
| [out] | g | Gradient, d/dx v, evaluated at x. |
|
static |
Compute the gradient for all variables starting from the end of the AD tape.
This function does not recover memory. The chain rule is applied working down the stack from the last vari created on the AD tape and then calling each vari's chain() method in turn.
This function computes a nested gradient only going back as far as the last nesting.
This function does not recover any memory from the computation.
|
static |
Compute the gradient for all variables starting from the specified root variable implementation.
Does not recover memory. This chainable variable's adjoint is initialized using the method init_dependent() and then the chain rule is applied working down the stack from this vari and calling each vari's chain() method in turn.
This function computes a nested gradient only going back as far as the last nesting.
This function does not recover any memory from the computation.
| vi | Variable implementation for root of partial derivative propagation. |
| void stan::math::grad_2F1 | ( | T & | g_a1, |
| T & | g_b1, | ||
| const T & | a1, | ||
| const T & | a2, | ||
| const T & | b1, | ||
| const T & | z, | ||
| double | precision = 1e-14, |
||
| int | max_steps = 1e6 |
||
| ) |
Gradients of the hypergeometric function, 2F1.
Calculate the gradients of the hypergeometric function (2F1) as the power series stopping when the series converges to within precision or throwing when the function takes max_steps steps.
This power-series representation converges for all gradients under the same conditions as the 2F1 function itself.
| T | type of arguments and result |
| [out] | g_a1 | g_a1 reference to gradient of 2F1 w.r.t. a1, result. |
| [out] | g_b1 | g_b1 reference to gradient of 2F1 w.r.t. b1, result. |
| [in] | a1 | a1 see generalized hypergeometric function definition. |
| [in] | a2 | a2 see generalized hypergeometric function definition. |
| [in] | b1 | b1 see generalized hypergeometric function definition. |
| [in] | z | z see generalized hypergeometric function definition. |
| [in] | precision | magnitude of the increment of the infinite sum to truncate the sum at. |
| [in] | max_steps | number of steps to take. |
Definition at line 39 of file grad_2F1.hpp.
| void stan::math::grad_F32 | ( | T * | g, |
| const T & | a1, | ||
| const T & | a2, | ||
| const T & | a3, | ||
| const T & | b1, | ||
| const T & | b2, | ||
| const T & | z, | ||
| const T & | precision = 1e-6, |
||
| int | max_steps = 1e5 |
||
| ) |
Gradients of the hypergeometric function, 3F2.
Calculate the gradients of the hypergeometric function (3F2) as the power series stopping when the series converges to within precision or throwing when the function takes max_steps steps.
This power-series representation converges for all gradients under the same conditions as the 3F2 function itself.
| T | type of arguments and result |
| [out] | g | g pointer to array of six values of type T, result. |
| [in] | a1 | a1 see generalized hypergeometric function definition. |
| [in] | a2 | a2 see generalized hypergeometric function definition. |
| [in] | a3 | a3 see generalized hypergeometric function definition. |
| [in] | b1 | b1 see generalized hypergeometric function definition. |
| [in] | b2 | b2 see generalized hypergeometric function definition. |
| [in] | z | z see generalized hypergeometric function definition. |
| [in] | precision | precision of the infinite sum |
| [in] | max_steps | number of steps to take |
Definition at line 39 of file grad_F32.hpp.
| void stan::math::grad_hessian | ( | const F & | f, |
| const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | x, | ||
| double & | fx, | ||
| Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > & | H, | ||
| std::vector< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > > & | grad_H | ||
| ) |
Calculate the value, the Hessian, and the gradient of the Hessian of the specified function at the specified argument.
The functor must implement
fvar<fvar<var> > operator()(const Eigen::Matrix<fvar<fvar<var> >, Eigen::Dynamic, 1>&)
using only operations that are defined for fvar and var.
This latter constraint usually requires the functions to be defined in terms of the libraries defined in Stan or in terms of functions with appropriately general namespace imports that eventually depend on functions defined in Stan.
| F | Type of function |
| [in] | f | Function |
| [in] | x | Argument to function |
| [out] | fx | Function applied to argument |
| [out] | H | Hessian of function at argument |
| [out] | grad_H | Gradient of the Hessian of function at argument |
Definition at line 42 of file grad_hessian.hpp.
|
inline |
Definition at line 22 of file grad_inc_beta.hpp.
| void stan::math::grad_inc_beta | ( | fvar< T > & | g1, |
| fvar< T > & | g2, | ||
| fvar< T > | a, | ||
| fvar< T > | b, | ||
| fvar< T > | z | ||
| ) |
Gradient of the incomplete beta function beta(a, b, z) with respect to the first two arguments.
Uses the equivalence to a hypergeometric function. See http://dlmf.nist.gov/8.17#ii
| T | inner type of the fvar |
| [out] | g1 | d/da |
| [out] | g2 | d/db |
| [in] | a | a |
| [in] | b | b |
| [in] | z | z |
Definition at line 34 of file grad_inc_beta.hpp.
|
inline |
Gradient of the incomplete beta function beta(a, b, z) with respect to the first two arguments.
Uses the equivalence to a hypergeometric function. See http://dlmf.nist.gov/8.17#ii
| [out] | g1 | d/da |
| [out] | g2 | d/db |
| [in] | a | a |
| [in] | b | b |
| [in] | z | z |
Definition at line 36 of file grad_inc_beta.hpp.
| void stan::math::grad_reg_inc_beta | ( | T & | g1, |
| T & | g2, | ||
| const T & | a, | ||
| const T & | b, | ||
| const T & | z, | ||
| const T & | digammaA, | ||
| const T & | digammaB, | ||
| const T & | digammaSum, | ||
| const T & | betaAB | ||
| ) |
Computes the gradients of the regularized incomplete beta function.
Specifically, this function computes gradients of ibeta(a, b, z), with respect to the arguments a and b.
| T | type of arguments |
| [out] | g1 | partial derivative of ibeta(a, b, z) with respect to a |
| [out] | g2 | partial derivative of ibeta(a, b, z) with respect to b |
| [in] | a | a |
| [in] | b | b |
| [in] | z | z |
| [in] | digammaA | the value of digamma(a) |
| [in] | digammaB | the value of digamma(b) |
| [in] | digammaSum | the value of digamma(a + b) |
| [in] | betaAB | the value of beta(a, b) |
Definition at line 33 of file grad_reg_inc_beta.hpp.
| return_type_t<T1, T2> stan::math::grad_reg_inc_gamma | ( | T1 | a, |
| T2 | z, | ||
| T1 | g, | ||
| T1 | dig, | ||
| double | precision = 1e-6, |
||
| int | max_steps = 1e5 |
||
| ) |
Gradient of the regularized incomplete gamma functions igamma(a, z)
For small z, the gradient is computed via the series expansion; for large z, the series is numerically inaccurate due to cancellation and the asymptotic expansion is used.
| T1 | type of the shape parameter |
| T2 | type of the location parameter |
| a | shape parameter, a > 0 |
| z | location z >= 0 |
| g | stan::math::tgamma(a) (precomputed value) |
| dig | boost::math::digamma(a) (precomputed value) |
| precision | required precision; applies to series expansion only |
| max_steps | number of steps to take. |
| throws | std::domain_error if not converged after max_steps or increment overflows to inf. |
For the asymptotic expansion, the gradient is given by:
\[ \begin{array}{rcl} \Gamma(a, z) & = & z^{a-1}e^{-z} \sum_{k=0}^N \frac{(a-1)_k}{z^k} \qquad , z \gg a\\ Q(a, z) & = & \frac{z^{a-1}e^{-z}}{\Gamma(a)} \sum_{k=0}^N \frac{(a-1)_k}{z^k}\\ (a)_k & = & (a)_{k-1}(a-k)\\ \frac{d}{da} (a)_k & = & (a)_{k-1} + (a-k)\frac{d}{da} (a)_{k-1}\\ \frac{d}{da}Q(a, z) & = & (log(z) - \psi(a)) Q(a, z)\\ && + \frac{z^{a-1}e^{-z}}{\Gamma(a)} \sum_{k=0}^N \left(\frac{d}{da} (a-1)_k\right) \frac{1}{z^k} \end{array} \]
Definition at line 52 of file grad_reg_inc_gamma.hpp.
| return_type_t<T1, T2> stan::math::grad_reg_lower_inc_gamma | ( | const T1 & | a, |
| const T2 & | z, | ||
| double | precision = 1e-10, |
||
| int | max_steps = 1e5 |
||
| ) |
Computes the gradient of the lower regularized incomplete gamma function.
The lower incomplete gamma function derivative w.r.t its first parameter (a) seems to have no standard source. It also appears to have no widely known approximate implementation. Gautschi (1979) has a thorough discussion of the calculation of the lower regularized incomplete gamma function itself and some stability issues.
Reference: Gautschi, Walter (1979) ACM Transactions on mathematical software. 5(4):466-481
We implemented calculations for d(gamma_p)/da by taking derivatives of formulas suggested by Gauschi and others and testing them against an outside source (Mathematica). We took three implementations which can cover the range {a:[0,20], z:[0,30]} with absolute error < 1e-10 with the exception of values near (0,0) where the error is near 1e-5. Relative error is also <<1e-6 except for regions where the gradient approaches zero.
Gautschi suggests calculating the lower incomplete gamma function for small to moderate values of $z$ using the approximation:
\[ \frac{\gamma(a,z)}{\Gamma(a)}=z^a e^-z \sum_n=0^\infty \frac{z^n}{\Gamma(a+n+1)} \]
We write the derivative in the form:
\[ \frac{d\gamma(a,z)\Gamma(a)}{da} = \frac{\log z}{e^z} \sum_n=0^\infty \frac{z^{a+n}}{\Gamma(a+n+1)} - \frac{1}{e^z} \sum_n=0^\infty \frac{z^{a+n}}{\Gamma(a+n+1)}\psi^0(a+n+1) \]
This calculation is sufficiently accurate for small $a$ and small $z$. For larger values and $a$ and $z$ we use it in its log form:
\[ \frac{d \gamma(a,z)\Gamma(a)}{da} = \frac{\log z}{e^z} \sum_n=0^\infty \exp[(a+n)\log z - \log\Gamma(a+n+1)] - \sum_n=0^\infty \exp[(a+n)\log z - \log\Gamma(a+n+1) + \log\psi^0(a+n+1)] \]
For large $z$, Gauschi recommends using the upper incomplete Gamma instead and the negative of its derivative turns out to be more stable and accurate for larger $z$ and for some combinations of $a$ and $z$. This is a log-scale implementation of the derivative of the formulation suggested by Gauschi (1979). For some values it defers to the negative of the gradient for the gamma_q function. This is based on the suggestion by Gauschi (1979) that for large values of $z$ it is better to carry out calculations using the upper incomplete Gamma function.
Branching for choice of implementation for the lower incomplete regularized gamma function gradient. The derivative based on Gautschi's formulation appears to be sufficiently accurate everywhere except for large z and small to moderate a. The intersection between the two regions is a radius 12 quarter circle centered at a=0, z=30 although both implementations are satisfactory near the intersection.
Some limits that could be treated, e.g., infinite z should return tgamma(a) * digamma(a), throw instead to match the behavior of, e.g., boost::math::gamma_p
| T1 | type of a |
| T2 | type of z |
| [in] | a | shared with complete Gamma |
| [in] | z | value to integrate up to |
| [in] | precision | series terminates when increment falls below this value. |
| [in] | max_steps | number of terms to sum before throwing |
| std::domain_error | if the series does not converge to requested precision before max_steps. |
Definition at line 110 of file grad_reg_lower_inc_gamma.hpp.
| void stan::math::grad_tr_mat_times_hessian | ( | const F & | f, |
| const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | x, | ||
| const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > & | M, | ||
| Eigen::Matrix< double, Eigen::Dynamic, 1 > & | grad_tr_MH | ||
| ) |
Definition at line 15 of file grad_tr_mat_times_hessian.hpp.
| void stan::math::gradient | ( | const F & | f, |
| const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | x, | ||
| T & | fx, | ||
| Eigen::Matrix< T, Eigen::Dynamic, 1 > & | grad_fx | ||
| ) |
Calculate the value and the gradient of the specified function at the specified argument.
The functor must implement
fvar<T> operator()(const Eigen::Matrix<T, Eigen::Dynamic, 1>&)
using only operations that are defined for fvar. This latter constraint usually requires the functions to be defined in terms of the libraries defined in Stan or in terms of functions with appropriately general namespace imports that eventually depend on functions defined in Stan.
Time and memory usage is on the order of the size of the fully unfolded expression for the function applied to the argument, independently of dimension.
| T | type of the elements in the vector |
| F | Type of function |
| [in] | f | Function |
| [in] | x | Argument to function |
| [out] | fx | Function applied to argument |
| [out] | grad_fx | Gradient of function at argument |
Definition at line 40 of file gradient.hpp.
| void stan::math::gradient | ( | const F & | f, |
| const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | x, | ||
| double & | fx, | ||
| Eigen::Matrix< double, Eigen::Dynamic, 1 > & | grad_fx | ||
| ) |
Calculate the value and the gradient of the specified function at the specified argument.
The functor must implement
var operator()(const Eigen::Matrix<var, Eigen::Dynamic, 1>&)
using only operations that are defined for var. This latter constraint usually requires the functions to be defined in terms of the libraries defined in Stan or in terms of functions with appropriately general namespace imports that eventually depend on functions defined in Stan.
Time and memory usage is on the order of the size of the fully unfolded expression for the function applied to the argument, independently of dimension.
| F | Type of function |
| [in] | f | Function |
| [in] | x | Argument to function |
| [out] | fx | Function applied to argument |
| [out] | grad_fx | Gradient of function at argument |
Definition at line 42 of file gradient.hpp.
| void stan::math::gradient_dot_vector | ( | const F & | f, |
| const Eigen::Matrix< T1, Eigen::Dynamic, 1 > & | x, | ||
| const Eigen::Matrix< T2, Eigen::Dynamic, 1 > & | v, | ||
| T1 & | fx, | ||
| T1 & | grad_fx_dot_v | ||
| ) |
Definition at line 13 of file gradient_dot_vector.hpp.
|
inline |
Definition at line 105 of file gumbel_lpdf.hpp.
|
inline |
Return the specified number of elements as a vector or row vector (same as input) from the front of the specified vector or row vector.
| T | type of the vector |
| v | Vector input. |
| n | Size of return. |
| std::out_of_range | if n is out of range. |
|
inline |
Return the specified number of elements as a vector or row vector (same as input) from the front of the specified vector or row vector.
| T_x | type of input kernel generator expression. |
| x | input kernel generator expression. |
| n | Size of return. |
| std::out_of_range | if n is out of range. |
| std::vector<T> stan::math::head | ( | const std::vector< T > & | sv, |
| size_t | n | ||
| ) |
Return the specified number of elements as a standard vector from the front of the specified standard vector.
| T | type of elements in the vector |
| sv | Standard vector. |
| n | Size of return. |
| std::out_of_range | if n is out of range. |
| void stan::math::hessian | ( | const F & | f, |
| const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | x, | ||
| T & | fx, | ||
| Eigen::Matrix< T, Eigen::Dynamic, 1 > & | grad, | ||
| Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | H | ||
| ) |
Calculate the value, the gradient, and the Hessian, of the specified function at the specified argument in time O(N^3) time and O(N^2) space.
The advantage over the mixed definition, which is faster for Hessians, is that this version is itself differentiable.
The functor must implement
fvar<fvar<T> > operator()(const Eigen::Matrix<fvar<fvar<T> >, Eigen::Dynamic, 1>&)
using only operations that are defined for the argument type.
This latter constraint usually requires the functions to be defined in terms of the libraries defined in Stan or in terms of functions with appropriately general namespace imports that eventually depend on functions defined in Stan.
| T | type of elements in the vector and matrix |
| F | type of function |
| [in] | f | Function |
| [in] | x | Argument to function |
| [out] | fx | Function applied to argument |
| [out] | grad | gradient of function at argument |
| [out] | H | Hessian of function at argument |
Definition at line 41 of file hessian.hpp.
| void stan::math::hessian | ( | const F & | f, |
| const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | x, | ||
| double & | fx, | ||
| Eigen::Matrix< double, Eigen::Dynamic, 1 > & | grad, | ||
| Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > & | H | ||
| ) |
Calculate the value, the gradient, and the Hessian, of the specified function at the specified argument in O(N^2) time and O(N^2) space.
The functor must implement
fvar<var> operator()(const Eigen::Matrix<fvar<var>, Eigen::Dynamic, 1>&)
using only operations that are defined for fvar and var.
This latter constraint usually requires the functions to be defined in terms of the libraries defined in Stan or in terms of functions with appropriately general namespace imports that eventually depend on functions defined in Stan.
| F | Type of function |
| [in] | f | Function |
| [in] | x | Argument to function |
| [out] | fx | Function applied to argument |
| [out] | grad | gradient of function at argument |
| [out] | H | Hessian of function at argument |
Definition at line 42 of file hessian.hpp.
| void stan::math::hessian_times_vector | ( | const F & | f, |
| const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | x, | ||
| const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | v, | ||
| double & | fx, | ||
| Eigen::Matrix< double, Eigen::Dynamic, 1 > & | Hv | ||
| ) |
Definition at line 14 of file hessian_times_vector.hpp.
| void stan::math::hessian_times_vector | ( | const F & | f, |
| const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | x, | ||
| const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | v, | ||
| T & | fx, | ||
| Eigen::Matrix< T, Eigen::Dynamic, 1 > & | Hv | ||
| ) |
Definition at line 39 of file hessian_times_vector.hpp.
|
inline |
Check arguments for hidden Markov model functions with a discrete latent state (lpdf, rng for latent states, and marginal probabilities for latent sates).
| T_omega | type of the log likelihood matrix |
| T_Gamma | type of the transition matrix |
| T_rho | type of the initial guess vector |
| [in] | log_omegas | log matrix of observational densities. |
| [in] | Gamma | transition density between hidden states. |
| [in] | rho | initial state |
| [in] | function | the name of the function using the arguments. |
| <tt>std::invalid_argument</tt> | if Gamma is not square or if the size of rho is not the number of rows of log_omegas. |
| <tt>std::domain_error</tt> | if rho is not a simplex or the rows of Gamma are not a simplex. |
Definition at line 30 of file hmm_check.hpp.
|
inline |
For a hidden Markov model with observation y, hidden state x, and parameters theta, compute the marginal probability vector for each x, given y and theta, p(x_i | y, theta).
In this setting, the hidden states are discrete and take values over the finite space {1, ..., K}. Hence for each hidden variable x, we compute a simplex with K elements. The final result is stored in a K by N matrix, where N is the length of x. log_omegas is a matrix of observational densities, where the (i, j)th entry corresponds to the density of the ith observation, y_i, given x_i = j. The transition matrix Gamma is such that the (i, j)th entry is the probability that x_n = j given x_{n - 1} = i. The rows of Gamma are simplexes. This function cannot be used to reconstruct the marginal distributon of a state sequence given parameters and an observation sequence, p(x | y, theta), because it only computes marginals on a state-by-state basis.
| T_omega | type of the log likelihood matrix |
| T_Gamma | type of the transition matrix |
| T_rho | type of the initial guess vector |
| [in] | log_omegas | log matrix of observational densities |
| [in] | Gamma | transition density between hidden states |
| [in] | rho | initial state |
| <tt>std::invalid_argument</tt> | if Gamma is not square or if the size of rho is not the number of rows of log_omegas |
| <tt>std::domain_error</tt> | if rho is not a simplex and of the rows of Gamma are not a simplex |
Definition at line 48 of file hmm_hidden_state_prob.hpp.
|
inline |
For a hidden Markov model with observation y, hidden state x, and parameters theta, generate samples from the posterior distribution of the hidden states, x.
In this setting, the hidden states are discrete and takes values over the finite space {1, ..., K}. log_omegas is a matrix of observational densities, where the (i, j)th entry corresponds to the density of the ith observation, y_i, given x_i = j. The transition matrix Gamma is such that the (i, j)th entry is the probability that x_n = j given x_{n - 1} = i. The rows of Gamma are simplexes.
| T_omega | type of the log likelihood matrix |
| T_Gamma | type of the transition matrix |
| T_rho | type of the initial guess vector |
| [in] | log_omegas | log matrix of observational densities. |
| [in] | Gamma | transition density between hidden states. |
| [in] | rho | initial state |
| [in] | rng | random number generator |
| <tt>std::invalid_argument</tt> | if Gamma is not square, when we have at least one transition, or if the size of rho is not the number of rows of log_omegas. |
| <tt>std::domain_error</tt> | if rho is not a simplex and of the rows of Gamma are not a simplex (when there is at least one transition). |
Definition at line 44 of file hmm_latent_rng.hpp.
|
inline |
For a Hidden Markov Model with observation y, hidden state x, and parameters theta, return the log marginal density, log p(y | theta).
In this setting, the hidden states are discrete and take values over the finite space {1, ..., K}. The marginal lpdf is obtained via a forward pass, and the derivative is calculated with an adjoint method, e.g (Betancourt, Margossian, & Leos-Barajas, 2020). log_omegas is a matrix of observational densities, where the (i, j)th entry corresponds to the density of the jth observation, y_j, given x_j = i. The transition matrix Gamma is such that the (i, j)th entry is the probability that x_n = j given x_{n - 1} = i. The rows of Gamma are simplexes.
| T_omega | type of the log likelihood matrix |
| T_Gamma | type of the transition matrix |
| T_rho | type of the initial guess vector |
| [in] | log_omegas | log matrix of observational densities. |
| [in] | Gamma | transition density between hidden states. |
| [in] | rho | initial state |
| <tt>std::invalid_argument</tt> | if Gamma is not square, when we have at least one transition, or if the size of rho is not the number of rows of log_omegas. |
| <tt>std::domain_error</tt> | if rho is not a simplex and of the rows of Gamma are not a simplex (when there is at least one transition). |
Definition at line 77 of file hmm_marginal.hpp.
|
inline |
Definition at line 20 of file hmm_marginal.hpp.
| Ptrs stan::math::holder | ( | T && | arg, |
| Ptrs *... | pointers | ||
| ) |
Definition at line 240 of file holder.hpp.
| T stan::math::holder | ( | T && | arg | ) |
Definition at line 245 of file holder.hpp.
| double stan::math::hypergeometric_lpmf | ( | const T_n & | n, |
| const T_N & | N, | ||
| const T_a & | a, | ||
| const T_b & | b | ||
| ) |
Definition at line 18 of file hypergeometric_lpmf.hpp.
|
inline |
Definition at line 59 of file hypergeometric_lpmf.hpp.
|
inline |
Definition at line 14 of file hypergeometric_rng.hpp.
|
inline |
Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11).
In symbols, if the arguments are x and y, the result is sqrt(x * x + y * y).
| x | First argument. |
| y | Second argument. |
|
inline |
Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11).
In symbols, if the arguments are 1 and x2, the result is sqrt(x1 * x1 + x2 * x2).
| T | inner type of the fvar |
| x1 | First argument. |
| x2 | Second argument. |
Returns the length of the hypotenuse of a right triangle with sides of the specified lengths (C99).
The partial derivatives are given by
\(\frac{\partial}{\partial x} \sqrt{x^2 + y^2} = \frac{x}{\sqrt{x^2 + y^2}}\), and
\(\frac{\partial}{\partial y} \sqrt{x^2 + y^2} = \frac{y}{\sqrt{x^2 + y^2}}\).
| [in] | a | Length of first side. |
| [in] | b | Length of second side. |
|
inline |
Enables the vectorised application of the hypot function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11).
In symbols, if the arguments are 1 and x2, the result is sqrt(x1 * x1 + x2 * x2).
| T | inner type of the fvar |
| x1 | First argument. |
| x2 | Second argument. |
Returns the length of the hypotenuse of a right triangle with sides of the specified lengths (C99).
The derivative is
\(\frac{d}{d x} \sqrt{x^2 + c^2} = \frac{x}{\sqrt{x^2 + c^2}}\).
| [in] | a | Length of first side. |
| [in] | b | Length of second side. |
Return the length of the hypotenuse of a right triangle with opposite and adjacent side lengths given by the specified arguments (C++11).
In symbols, if the arguments are 1 and x2, the result is sqrt(x1 * x1 + x2 * x2).
| T | inner type of the fvar |
| x1 | First argument. |
| x2 | Second argument. |
Returns the length of the hypotenuse of a right triangle with sides of the specified lengths (C99).
The derivative is
\(\frac{d}{d y} \sqrt{c^2 + y^2} = \frac{y}{\sqrt{c^2 + y^2}}\).
\[ \mbox{hypot}(x, y) = \begin{cases} \textrm{NaN} & \mbox{if } x < 0 \text{ or } y < 0 \\ \sqrt{x^2+y^2} & \mbox{if } x, y\geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{hypot}(x, y)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < 0 \text{ or } y < 0 \\ \frac{x}{\sqrt{x^2+y^2}} & \mbox{if } x, y\geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{hypot}(x, y)}{\partial y} = \begin{cases} \textrm{NaN} & \mbox{if } x < 0 \text{ or } y < 0 \\ \frac{y}{\sqrt{x^2+y^2}} & \mbox{if } x, y\geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| [in] | a | Length of first side. |
| [in] | b | Length of second side. |
|
inline |
Return the specified complex number multiplied by i.
This compound function is more efficient than mulitplying by a constant i because it involves only a single arithmetic negation.
| value | type of complex argument |
| [in] | z | complex argument |
i Definition at line 20 of file i_times.hpp.
|
inline |
Returns the result of applying the identity constraint transform to the input.
This promotes the input to the least upper bound of the input types.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | type of value to promote |
| Types | Other types. |
| [in] | x | object |
This specialization handles convert Eigen matrices of doubles to var matrix types.
| T | Any type. |
| Types | Any type with one of T and Types being a var_value matrix. |
| [in] | x | object |
Definition at line 23 of file identity_constrain.hpp.
|
inline |
Returns the result of applying the inverse of the identity constraint transform to the input.
Returns the result of applying the identity constraint transform to the input.
This promotes the input to the least upper bound of the input types.
| T | type of value to promote |
| Types | Other types. |
| [in] | x | value to promote |
For any of the inputs being a var_value type this promotes the input x to var_value.
| T | Any type. |
| Types | Any type with one of T and Types being a var_value matrix. |
| [in] | x | object |
Definition at line 22 of file identity_free.hpp.
|
inline |
Return a square identity matrix.
| K | size of the matrix |
| std::domain_error | if K is negative. |
Definition at line 19 of file identity_matrix.hpp.
If the specified condition is true, return the first variable, otherwise return the second variable.
| c | Boolean condition. |
| y_true | Variable to return if condition is true. |
| y_false | Variable to return if condition is false. |
Definition at line 18 of file if_else.hpp.
|
inline |
Return the second argument if the first argument is true and otherwise return the second argument.
This is just a convenience method to provide a function with the same behavior as the built-in ternary operator. In general, this function behaves as if defined by
if_else(c, y1, y0) = c ? y1 : y0.
| T_true | type of the true argument |
| T_false | type of the false argument |
| c | Boolean condition value. |
| y_true | Value to return if condition is true. |
| y_false | Value to return if condition is false. |
Definition at line 26 of file if_else.hpp.
If the specified condition is true, return a new variable constructed from the first scalar, otherwise return the second variable.
| c | Boolean condition. |
| y_true | Value to promote to variable and return if condition is true. |
| y_false | Variable to return if condition is false. |
Definition at line 30 of file if_else.hpp.
If the specified condition is true, return the first variable, otherwise return a new variable constructed from the second scalar.
| c | Boolean condition. |
| y_true | Variable to return if condition is true. |
| y_false | Value to promote to variable and return if condition is false. |
Definition at line 46 of file if_else.hpp.
| T stan::math::imag | ( | const std::complex< T > & | z | ) |
|
inline |
Definition at line 19 of file inc_beta.hpp.
|
inline |
The normalized incomplete beta function of a, b, with outcome x.
Used to compute the cumulative density function for the beta distribution.
| a | Shape parameter a >= 0; a and b can't both be 0 |
| b | Shape parameter b >= 0 |
| x | Random variate. 0 <= x <= 1 |
| if | constraints are violated or if any argument is NaN |
Definition at line 24 of file inc_beta.hpp.
|
inline |
Definition at line 32 of file inc_beta.hpp.
|
inline |
Definition at line 36 of file inc_beta.hpp.
Definition at line 38 of file inc_beta.hpp.
|
inline |
Definition at line 40 of file inc_beta.hpp.
|
inline |
Definition at line 45 of file inc_beta.hpp.
|
inline |
Definition at line 49 of file inc_beta.hpp.
|
inline |
Definition at line 53 of file inc_beta.hpp.
| T stan::math::inc_beta_dda | ( | T | a, |
| T | b, | ||
| T | z, | ||
| T | digamma_a, | ||
| T | digamma_ab | ||
| ) |
Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to a.
The power series used to compute the derivative tends to converge slowly when a and b are large, especially if z approaches 1. The implementation will throw an exception if the series have not converged within 100,000 iterations. The current implementation has been tested for values of a and b up to 12500 and z = 0.999.
| T | scalar types of arguments |
| a | first argument |
| b | second argument |
| z | upper bound of the integral |
| digamma_a | value of digamma(a) |
| digamma_ab | value of digamma(b) |
Definition at line 39 of file inc_beta_dda.hpp.
| T stan::math::inc_beta_ddb | ( | T | a, |
| T | b, | ||
| T | z, | ||
| T | digamma_b, | ||
| T | digamma_ab | ||
| ) |
Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to b.
The power series used to compute the derivative tends to converge slowly when a and b are large, especially if z approaches 1. The implementation will throw an exception if the series have not converged within 100,000 iterations. The current implementation has been tested for values of a and b up to 12500 and z = 0.999.
| T | scalar types of arguments |
| a | first argument |
| b | second argument |
| z | upper bound of the integral |
| digamma_b | value of digamma(b) |
| digamma_ab | value of digamma(b) |
Definition at line 42 of file inc_beta_ddb.hpp.
| T stan::math::inc_beta_ddz | ( | T | a, |
| T | b, | ||
| T | z | ||
| ) |
Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to z.
| T | scalar types of arguments |
| a | first argument |
| b | second argument |
| z | upper bound of the integral |
Definition at line 29 of file inc_beta_ddz.hpp.
|
inline |
Definition at line 37 of file inc_beta_ddz.hpp.
| constexpr auto stan::math::index_apply | ( | F | f | ) |
Calls given callable with an index sequence.
Combination of this and a lambda can be used to avoid separating implementation that needs an index sequence from functions that operate on tuples of parameter packs.
| N | size of index sequence to use |
| F | callable type |
| f | callable |
Definition at line 26 of file index_apply.hpp.
| void stan::math::indexing_rev | ( | matrix_cl< double > & | adj, |
| const matrix_cl< int > & | idx, | ||
| const matrix_cl< double > & | res | ||
| ) |
Performs reverse pass for indexing operation on the OpenCL device.
Depending on the size of indexed matrix and the amount of local memory available on the device selects the best kernel to use for the operation.
| [in,out] | adj | adjoint of the argument to indexing |
| idx | indices | |
| res | adjoint of the result of the indexing operation |
Definition at line 22 of file indexing_rev.hpp.
|
inline |
Initialize the Intel TBB threadpool and global scheduler through the tbb::task_scheduler_init object.
In case an instance of the tbb::task_scheduler_object has been instantiated prior to calling this function, then any subsequent initialization is ignored by the Intel TBB.
The maximal number of threads is read from the environment variable STAN_NUM_THREADS using internal::get_num_threads. See conventions of get_num_threads. The TBB scheduler will be activated by calling this function.
The function returns a reference to the static tbb::task_scheduler_init instance.
| n_threads | The maximum number of threads available to the tbb. If not set will search for the environment variable STAN_NUM_THREADS. A value of will assume all detectable threads are available for the process. |
| std::runtime_error | if n_threads (defaults to zero) is not provided and the value of STAN_NUM_THREADS environment variable is invalid. |
Definition at line 145 of file init_threadpool_tbb.hpp.
|
inline |
Definition at line 17 of file initialize.hpp.
|
inline |
Definition at line 22 of file initialize.hpp.
|
inline |
Definition at line 27 of file initialize.hpp.
|
inline |
Fill the specified container with the specified value.
The specified matrix is filled by element.
| EigMat | Type inheriting from EigenBase |
| S | Type of value. |
| x | Container. |
| y | Value. |
Definition at line 24 of file initialize_fill.hpp.
|
inline |
Fill the specified container with the specified value.
This function does not perform a callback to propogate the adjoints upward
The specified matrix is filled by element.
| VarMat | a var_value with inner type from EigenBase |
| S | A var. |
| x | Container. |
| y | Value. |
Definition at line 26 of file initialize_fill.hpp.
|
inline |
Fill the specified container with the specified value.
This base case simply assigns the value to the container.
| T | Type of reference container. |
| S | Type of value. |
| x | Container. |
| y | Value. |
Definition at line 41 of file initialize_fill.hpp.
|
inline |
Fill the specified container with the specified value.
Each container in the specified standard vector is filled recursively by calling fill.
| Vec | A standard vector |
| S | type of value |
| [in] | x | Container. |
| [in,out] | y | Value. |
Definition at line 57 of file initialize_fill.hpp.
Initialize variable to value.
(Function may look pointless, but it's needed to bottom out recursion.)
Definition at line 16 of file initialize_variable.hpp.
|
inline |
Initialize every cell in the matrix to the specified value.
| R | number of rows, can be Eigen::Dynamic |
| C | number of columns, can be Eigen::Dynamic |
Definition at line 27 of file initialize_variable.hpp.
|
inline |
Initialize the variables in the standard vector recursively.
| T | type of elements in the vector |
Definition at line 38 of file initialize_variable.hpp.
|
inline |
The integer step, or Heaviside, function.
For double NaN input, int_step(NaN) returns 0.
\[ \mbox{int\_step}(x) = \begin{cases} 0 & \mbox{if } x \leq 0 \\ 1 & \mbox{if } x > 0 \\[6pt] 0 & \mbox{if } x = \textrm{NaN} \end{cases} \]
| T | value type |
| [in] | y | value |
Definition at line 27 of file int_step.hpp.
|
inline |
Integrate a single variable function f from a to b to within a specified relative tolerance.
This function assumes a is less than b.
The signature for f should be: double f(double x, double xc)
It should return the value of the function evaluated at x.
Depending on whether or not a is finite or negative infinity and b is finite or positive infinity, a different version of the 1d quadrature algorithm from the Boost quadrature library is chosen.
Integrals that cross zero are broken into two, and the separate integrals are each integrated to the given relative tolerance.
For integrals with finite limits, the xc argument is the distance to the nearest boundary. So for a > 0, b > 0, it will be a - x for x closer to a, and b - x for x closer to b. xc is computed in a way that avoids the precision loss of computing a - x or b - x manually. For integrals that cross zero, xc can take values a - x, -x, or b - x depending on which integration limit it is nearest.
If either limit is infinite, xc is set to NaN
| T | Type of f |
| f | the function to be integrated |
| a | lower limit of integration |
| b | upper limit of integration |
| relative_tolerance | target relative tolerance passed to Boost quadrature |
If the integral crosses zero, break it into two (advice from the Boost implementation: https://www.boost.org/doc/libs/1_66_0/libs/math/doc/html/math_toolkit/double_exponential/de_caveats.html)
Definition at line 52 of file integrate_1d.hpp.
|
inline |
Compute the integral of the single variable function f from a to b to within a specified relative tolerance.
a and b can be finite or infinite.
f should be compatible with reverse mode autodiff and have the signature: var f(double x, double xc, const std::vector<var>& theta, const std::vector<double>& x_r, const std::vector<int> &x_i, std::ostream* msgs)
It should return the value of the function evaluated at x. Any errors should be printed to the msgs stream.
Integrals that cross zero are broken into two, and the separate integrals are each integrated to the given relative tolerance.
For integrals with finite limits, the xc argument is the distance to the nearest boundary. So for a > 0, b > 0, it will be a - x for x closer to a, and b - x for x closer to b. xc is computed in a way that avoids the precision loss of computing a - x or b - x manually. For integrals that cross zero, xc can take values a - x, -x, or b - x depending on which integration limit it is nearest.
If either limit is infinite, xc is set to NaN
The integration algorithm terminates when
\[ \frac{{|I_{n + 1} - I_n|}}{{|I|_{n + 1}}} < \text{relative tolerance} \]
where \(I_{n}\) is the nth estimate of the integral and \(|I|_{n}\) is the nth estimate of the norm of the integral.
Integrals that cross zero are split into two. In this case, each integral is separately integrated to the given relative_tolerance.
Gradients of f that evaluate to NaN when the function evaluates to zero are set to zero themselves. This is due to the autodiff easily overflowing to NaN when evaluating gradients near the maximum and minimum floating point values (where the function should be zero anyway for the integral to exist)
| T_a | type of first limit |
| T_b | type of second limit |
| T_theta | type of parameters |
| T | Type of f |
| f | the functor to integrate | |
| a | lower limit of integration | |
| b | upper limit of integration | |
| theta | additional parameters to be passed to f | |
| x_r | additional data to be passed to f | |
| x_i | additional integer data to be passed to f | |
| [in,out] | msgs | the print stream for warning messages |
| relative_tolerance | relative tolerance passed to Boost quadrature |
Definition at line 215 of file integrate_1d.hpp.
|
inline |
Compute the integral of the single variable function f from a to b to within a specified relative tolerance.
a and b can be finite or infinite.
The signature for f should be: double f(double x, double xc, const std::vector<double>& theta, const std::vector<double>& x_r, const std::vector<int>& x_i, std::ostream* msgs)
It should return the value of the function evaluated at x. Any errors should be printed to the msgs stream.
Integrals that cross zero are broken into two, and the separate integrals are each integrated to the given relative tolerance.
For integrals with finite limits, the xc argument is the distance to the nearest boundary. So for a > 0, b > 0, it will be a - x for x closer to a, and b - x for x closer to b. xc is computed in a way that avoids the precision loss of computing a - x or b - x manually. For integrals that cross zero, xc can take values a - x, -x, or b - x depending on which integration limit it is nearest.
If either limit is infinite, xc is set to NaN
The integration algorithm terminates when
\[ \frac{{|I_{n + 1} - I_n|}}{{|I|_{n + 1}}} < \text{relative tolerance} \]
where \(I_{n}\) is the nth estimate of the integral and \(|I|_{n}\) is the nth estimate of the norm of the integral.
Integrals that cross zero are split into two. In this case, each integral is separately integrated to the given relative_tolerance.
| T | Type of f |
| f | the function to be integrated | |
| a | lower limit of integration | |
| b | upper limit of integration | |
| theta | additional parameters to be passed to f | |
| x_r | additional data to be passed to f | |
| x_i | additional integer data to be passed to f | |
| [in,out] | msgs | the print stream for warning messages |
| relative_tolerance | tolerance passed to Boost quadrature |
Definition at line 240 of file integrate_1d.hpp.
|
inline |
Return the integral of f from a to b to the given relative tolerance.
| F | Type of f |
| T_a | type of first limit |
| T_b | type of second limit |
| Args | types of parameter pack arguments |
| f | the functor to integrate | |
| a | lower limit of integration | |
| b | upper limit of integration | |
| relative_tolerance | relative tolerance passed to Boost quadrature | |
| [in,out] | msgs | the print stream for warning messages |
| args | additional arguments to pass to f |
Definition at line 40 of file integrate_1d.hpp.
|
inline |
Compute the integral of the single variable function f from a to b to within a specified relative tolerance.
a and b can be finite or infinite.
| T | Type of f |
| f | the function to be integrated | |
| a | lower limit of integration | |
| b | upper limit of integration | |
| relative_tolerance | tolerance passed to Boost quadrature | |
| [in,out] | msgs | the print stream for warning messages |
| args | additional arguments passed to f |
Definition at line 176 of file integrate_1d.hpp.
| std::vector<std::vector<Tpar> > stan::math::integrate_dae | ( | const F & | f, |
| const std::vector< double > & | yy0, | ||
| const std::vector< double > & | yp0, | ||
| double | t0, | ||
| const std::vector< double > & | ts, | ||
| const std::vector< Tpar > & | theta, | ||
| const std::vector< double > & | x_r, | ||
| const std::vector< int > & | x_i, | ||
| const double | rtol, | ||
| const double | atol, | ||
| const int64_t | max_num_steps = idas_integrator::IDAS_MAX_STEPS, |
||
| std::ostream * | msgs = nullptr |
||
| ) |
Return the solutions for a semi-explicit DAE system with residual specified by functor F, given the specified consistent initial state yy0 and yp0.
| DAE | type of DAE system |
| Tpar | scalar type of parameter theta |
| [in] | f | functor for the base ordinary differential equation |
| [in] | yy0 | initial state |
| [in] | yp0 | initial derivative state |
| [in] | t0 | initial time |
| [in] | ts | times of the desired solutions, in strictly increasing order, all greater than the initial time |
| [in] | theta | parameters |
| [in] | x_r | real data |
| [in] | x_i | int data |
| [in] | rtol | relative tolerance passed to IDAS, required <10^-3 |
| [in] | atol | absolute tolerance passed to IDAS, problem-dependent |
| [in] | max_num_steps | maximal number of admissable steps between time-points |
| [in] | msgs | message |
Definition at line 39 of file integrate_dae.hpp.
| std::vector<std::vector<return_type_t<T_y0, T_param, T_t0, T_ts> > > stan::math::integrate_ode_adams | ( | const F & | f, |
| const std::vector< T_y0 > & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| const std::vector< T_param > & | theta, | ||
| const std::vector< double > & | x, | ||
| const std::vector< int > & | x_int, | ||
| std::ostream * | msgs = nullptr, |
||
| double | relative_tolerance = 1e-10, |
||
| double | absolute_tolerance = 1e-10, |
||
| long int | max_num_steps = 1e8 |
||
| ) |
ode_adams Definition at line 19 of file integrate_ode_adams.hpp.
| std::vector<std::vector<return_type_t<T_y0, T_param, T_t0, T_ts> > > stan::math::integrate_ode_bdf | ( | const F & | f, |
| const std::vector< T_y0 > & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| const std::vector< T_param > & | theta, | ||
| const std::vector< double > & | x, | ||
| const std::vector< int > & | x_int, | ||
| std::ostream * | msgs = nullptr, |
||
| double | relative_tolerance = 1e-10, |
||
| double | absolute_tolerance = 1e-10, |
||
| long int | max_num_steps = 1e8 |
||
| ) |
ode_bdf Definition at line 19 of file integrate_ode_bdf.hpp.
|
inline |
ode_rk45 Definition at line 18 of file integrate_ode_rk45.hpp.
|
inline |
Return the elementwise 1.0 / x of the specified argument, which may be a scalar or any Stan container of numeric scalars.
| T_x | type of input kernel generator expression x |
| x | Input kernel generator expression. |
|
inline |
| T | Arithmetic or a type inheriting from EigenBase. \[ \mbox{inv}(x) = \begin{cases} \frac{1}{x} & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \] |
\[ \frac{\partial\, \mbox{inv}(x)}{\partial x} = \begin{cases} -\frac{1}{x^2} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
|
inline |
|
inline |
|
inline |
Definition at line 103 of file inv_chi_square_lpdf.hpp.
Definition at line 13 of file inv_cloglog.hpp.
|
inline |
Returns the elementwise inv_cloglog() of a var_value<matrix_cl<double>>.
| A | argument |
inv_cloglog() of the input. Definition at line 20 of file inv_cloglog.hpp.
|
inline |
Return the inverse complementary log-log function applied specified variable (stan).
See inv_cloglog() for the double-based version.
The derivative is given by
\(\frac{d}{dx} \mbox{cloglog}^{-1}(x) = \exp (x - \exp (x))\).
| T | Arithmetic or a type inheriting from EigenBase. |
| a | Variable argument. |
Definition at line 28 of file inv_cloglog.hpp.
|
inline |
The inverse complementary log-log function.
The function is defined by
inv_cloglog(x) = 1 - exp(-exp(x)).
This function can be used to implement the inverse link function for complementary-log-log regression.
\[ \mbox{inv\_cloglog}(y) = \begin{cases} \mbox{cloglog}^{-1}(y) & \mbox{if } -\infty\leq y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{inv\_cloglog}(y)}{\partial y} = \begin{cases} \frac{\partial\, \mbox{cloglog}^{-1}(y)}{\partial y} & \mbox{if } -\infty\leq y\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } y = \textrm{NaN} \end{cases} \]
\[ \mbox{cloglog}^{-1}(y) = 1 - \exp \left( - \exp(y) \right) \]
\[ \frac{\partial \, \mbox{cloglog}^{-1}(y)}{\partial y} = \exp(y-\exp(y)) \]
| x | Argument. |
Definition at line 48 of file inv_cloglog.hpp.
|
inline |
The inverse complementary log-log function.
The function is defined by
inv_cloglog(x) = 1 - exp(-exp(x)).
This function can be used to implement the inverse link function for complementary-log-log regression.
\[ \mbox{inv\_cloglog}(y) = \begin{cases} \mbox{cloglog}^{-1}(y) & \mbox{if } -\infty\leq y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{inv\_cloglog}(y)}{\partial y} = \begin{cases} \frac{\partial\, \mbox{cloglog}^{-1}(y)}{\partial y} & \mbox{if } -\infty\leq y\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } y = \textrm{NaN} \end{cases} \]
\[ \mbox{cloglog}^{-1}(y) = 1 - \exp \left( - \exp(y) \right) \]
\[ \frac{\partial \, \mbox{cloglog}^{-1}(y)}{\partial y} = \exp(y-\exp(y)) \]
| T_x | type of input kernel generator expression x |
| x | Argument. |
Definition at line 53 of file inv_cloglog.hpp.
|
inline |
Vectorized version of inv_cloglog().
| Container | type of container |
| x | container |
Definition at line 79 of file inv_cloglog.hpp.
|
inline |
Version of inv_cloglog() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these.
| Container | Type of x |
| x | Container |
Definition at line 93 of file inv_cloglog.hpp.
| return_type_t<T_y, T_shape, T_scale> stan::math::inv_gamma_lccdf | ( | const T_y & | y, |
| const T_shape & | alpha, | ||
| const T_scale & | beta | ||
| ) |
Definition at line 25 of file inv_gamma_lccdf.hpp.
| return_type_t<T_y, T_shape, T_scale> stan::math::inv_gamma_lcdf | ( | const T_y & | y, |
| const T_shape & | alpha, | ||
| const T_scale & | beta | ||
| ) |
Definition at line 25 of file inv_gamma_lcdf.hpp.
|
inline |
Definition at line 116 of file inv_gamma_lpdf.hpp.
Returns the inverse logit function applied to the argument.
| T | inner type of the fvar |
| x | argument |
Definition at line 20 of file inv_logit.hpp.
|
inline |
Returns the elementwise inv_logit() of a var_value<matrix_cl<double>>.
| A | argument |
inv_logit() of the input. Definition at line 20 of file inv_logit.hpp.
|
inline |
The inverse logit function for variables (stan).
See inv_logit() for the double-based version.
The derivative of inverse logit is
\(\frac{d}{dx} \mbox{logit}^{-1}(x) = \mbox{logit}^{-1}(x) (1 - \mbox{logit}^{-1}(x))\).
| T | Arithmetic or a type inheriting from EigenBase. |
| a | Argument variable. |
Definition at line 26 of file inv_logit.hpp.
|
inline |
Returns the inverse logit function applied to the argument.
The inverse logit function is defined by
\(\mbox{logit}^{-1}(x) = \frac{1}{1 + \exp(-x)}\).
This function can be used to implement the inverse link function for logistic regression.
The inverse to this function is logit.
\[ \mbox{inv\_logit}(y) = \begin{cases} \mbox{logit}^{-1}(y) & \mbox{if } -\infty\leq y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{inv\_logit}(y)}{\partial y} = \begin{cases} \frac{\partial\, \mbox{logit}^{-1}(y)}{\partial y} & \mbox{if } -\infty\leq y\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } y = \textrm{NaN} \end{cases} \]
\[ \mbox{logit}^{-1}(y) = \frac{1}{1 + \exp(-y)} \]
\[ \frac{\partial \, \mbox{logit}^{-1}(y)}{\partial y} = \frac{\exp(y)}{(\exp(y)+1)^2} \]
| a | Argument. |
Definition at line 51 of file inv_logit.hpp.
|
inline |
Vectorized version of inv_logit().
| T | type of container |
| x | container |
Definition at line 87 of file inv_logit.hpp.
Definition at line 15 of file inv_Phi.hpp.
|
inline |
Returns the elementwise inv_Phi() of a var_value<matrix_cl<double>>.
| A | argument |
inv_Phi() of the input. Definition at line 20 of file inv_Phi.hpp.
The inverse of unit normal cumulative density function.
The derivative is the reciprocal of unit normal density function,
| p | Probability |
Definition at line 21 of file inv_Phi.hpp.
|
inline |
Return the elementwise inverse of unit normal cumulative density function.
| p | Probability vector |
Definition at line 35 of file inv_Phi.hpp.
|
inline |
Return the value of the inverse standard normal cumulative distribution function at the specified argument.
The precision is at or better than 1.5e-15 for values between 0.0000001 he largest integer that protects against floating point errors for the inv_Phi function. The value was found by finding the largest integer that passed the unit tests for accuracy when the input into inv_Phi is near 1.
| p | argument between 0 and 1 inclusive |
Definition at line 147 of file inv_Phi.hpp.
|
inline |
Vectorized version of inv_Phi().
| T | type of container |
| x | variables in range [0, 1] |
| std::domain_error | if any value is not between 0 and 1. |
Definition at line 181 of file inv_Phi.hpp.
Definition at line 12 of file inv_sqrt.hpp.
|
inline |
Definition at line 16 of file inv_sqrt.hpp.
|
inline |
Returns the elementwise inv_sqrt() of a var_value<matrix_cl<double>>.
| A | argument |
inv_sqrt() of the input. Definition at line 20 of file inv_sqrt.hpp.
|
inline |
Return the elementwise 1 / sqrt(x) of the specified kernel generator expression.
| T_x | type of input kernel generator expression x |
| x | input kernel generator expression |
Definition at line 21 of file inv_sqrt.hpp.
|
inline |
| T | Arithmetic or a type inheriting from EigenBase. |
\[ \mbox{inv\_sqrt}(x) = \begin{cases} \frac{1}{\sqrt{x}} & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{inv\_sqrt}(x)}{\partial x} = \begin{cases} -\frac{1}{2\sqrt{x^3}} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
Definition at line 34 of file inv_sqrt.hpp.
|
inline |
Return the elementwise 1 / sqrt(x)} of the specified argument, which may be a scalar or any Stan container of numeric scalars.
| Container | type of container |
| x | container |
Definition at line 48 of file inv_sqrt.hpp.
|
inline |
Version of inv_sqrt() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these.
| Container | Type of x |
| x | Container |
Definition at line 62 of file inv_sqrt.hpp.
Definition at line 12 of file inv_square.hpp.
|
inline |
Returns the elementwise inv_square() of a var_value<matrix_cl<double>>.
| A | argument |
inv_square() of the input. Definition at line 20 of file inv_square.hpp.
|
inline |
Returns 1 / square(x).
| Container | type of container |
| x | container |
1 / square(x) of each value in x. Definition at line 23 of file inv_square.hpp.
\[ \mbox{inv\_square}(x) = \begin{cases} \frac{1}{x^2} & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{inv\_square}(x)}{\partial x} = \begin{cases} -\frac{2}{x^3} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
Definition at line 30 of file inv_square.hpp.
|
inline |
Version of inv_square() that accepts Eigen Matrix/Array objects or expressions.
| T | Type of x |
| x | Eigen Matrix/Array or expression |
Definition at line 37 of file inv_square.hpp.
|
inline |
Definition at line 92 of file inv_wishart_lpdf.hpp.
|
inline |
Definition at line 13 of file inv_wishart_rng.hpp.
|
inline |
Throw an invalid_argument exception with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing invalid argument. This will allow us to change the behavior for all functions at once. The message is: "<function>: <name> <msg1><y><msg2>"
| T | Type of variable |
| function | Name of the function |
| name | Name of the variable |
| y | Variable |
| msg1 | Message to print before the variable |
| msg2 | Message to print after the variable |
| std::invalid_argument |
Definition at line 27 of file invalid_argument.hpp.
|
inline |
Throw an invalid_argument exception with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing invalid argument. This will allow us to change the behavior for all functions at once. (We've already changed behavior multiple times up to Stan v2.5.0.) The message is: "<function>: <name> <msg1><y>"
| T | Type of variable |
| function | Name of the function |
| name | Name of the variable |
| y | Variable |
| msg1 | Message to print before the variable |
| std::invalid_argument |
Definition at line 49 of file invalid_argument.hpp.
|
inline |
Throw an invalid argument exception with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing invalid arguments. This will allow us to change the behavior for all functions at once. (We've already changed behavior multiple times up to Stan v2.5.0.) The message is: "<function>: <name>[<i+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.
| T | Type of variable |
| function | Name of the function |
| name | Name of the variable |
| y | Variable |
| i | Index |
| msg1 | Message to print before the variable |
| msg2 | Message to print after the variable |
| std::invalid_argument |
Definition at line 33 of file invalid_argument_vec.hpp.
|
inline |
Throw an invalid argument exception with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing invalid arguments. This will allow us to change the behavior for all functions at once. (We've already changed behavior multiple times up to Stan v2.5.0.) The message is: "<function>: <name>[<i+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.
| T | Type of variable |
| function | Name of the function |
| name | Name of the variable |
| y | Variable |
| i | Index |
| msg | Message to print before the variable |
| std::invalid_argument |
Definition at line 61 of file invalid_argument_vec.hpp.
|
inline |
Reverse mode specialization of calculating the inverse of the matrix.
| m | specified matrix |
| std::invalid_argument | if the matrix is not square. |
Definition at line 23 of file inverse.hpp.
|
inline |
Forward mode specialization of calculating the inverse of the matrix.
Returns the inverse of the specified matrix.
| T | type of elements in the matrix |
| m | specified matrix |
| std::invalid_argument | if the matrix is not square. |
| T | type of elements in the matrix |
| R | number of rows, can be Eigen::Dynamic |
| C | number of columns, can be Eigen::Dynamic |
| m | specified matrix |
| std::invalid_argument | if the matrix is not square. |
Definition at line 29 of file inverse.hpp.
| void stan::math::inverse_softmax | ( | const Vector & | simplex, |
| Vector & | y | ||
| ) |
Writes the inverse softmax of the simplex argument into the second argument.
See softmax for the inverse function and a definition of the relation.
The inverse softmax function is defined by
\(\mbox{inverse\_softmax}(x)[i] = \log x[i]\).
This function defines the inverse of softmax up to a scaling factor.
Because of the definition, values of 0.0 in the simplex are converted to negative infinity, and values of 1.0 are converted to 0.0.
There is no check that the input vector is a valid simplex vector.
| Vector | type of the simplex vector |
| simplex | Simplex vector input. |
| y | Vector into which the inverse softmax is written. |
| std::invalid_argument | if size of the input and output vectors differ. |
Definition at line 37 of file inverse_softmax.hpp.
|
inline |
Returns the inverse of the specified symmetric, pos/neg-definite matrix.
| EigMat | type of elements in the matrix |
| m | specified matrix |
| std::invalid_argument | if the matrix is not symmetric. |
| std::domain_error | if the matrix is not positive definite. |
Definition at line 23 of file inverse_spd.hpp.
| bool stan::math::is_aligned | ( | T * | ptr, |
| unsigned int | bytes_aligned | ||
| ) |
Return true if the specified pointer is aligned on the number of bytes.
This doesn't really make sense other than for powers of 2.
| ptr | Pointer to test. |
| bytes_aligned | Number of bytes of alignment required. |
true if pointer is aligned. | Type | of object to which pointer points. |
Definition at line 29 of file stack_alloc.hpp.
|
inline |
Returns true if the input is NaN and false otherwise.
Delegates to stan::math::is_nan so that appropriate specializations can be loaded for autodiff types.
| x | Value to test. |
true if the value is NaN. Definition at line 21 of file is_any_nan.hpp.
|
inline |
Returns true if any input is NaN and false otherwise.
Delegates to stan::math::is_nan.
| x | first argument |
| xs | parameter pack of remaining arguments to forward to function |
true if any value is NaN Definition at line 35 of file is_any_nan.hpp.
|
inline |
Return true if y is a valid Cholesky factor, if number of rows is not less than the number of columns, if there are no 0 columns, and no element in matrix is NaN.
A Cholesky factor is a lower triangular matrix whose diagonal elements are all positive. Note that Cholesky factors need not be square, but require at least as many rows M as columns N (i.e., M >= N).
| EigMat | A type derived from EigenBase with dynamic rows and columns |
| y | Matrix to test |
true if y is a valid Cholesky factor, if number of rows is not less than the number of columns, if there are no 0 columns, and no element in matrix is NaN Definition at line 29 of file is_cholesky_factor.hpp.
|
inline |
Return true if y is a valid Cholesky factor, if the number of rows is not less than the number of columns, if there are no zero columns, and no element in matrix is NaN.
A Cholesky factor is a lower triangular matrix whose diagonal elements are all positive. This definition does not require a square matrix.
| EigMat | A type derived from EigenBase with dynamic rows and columns |
| y | Matrix to test |
true if y is a valid Cholesky factor, if the number of rows is not less than the number of columns, if there are no 0 columns, and no element in matrix is NaN Definition at line 26 of file is_cholesky_factor_corr.hpp.
|
inline |
Return true if column index is in bounds.
By default this is a 1-indexed check (as opposed to zero-indexed). Behavior can be changed by setting stan::error_index::value.
| EigMat | A type derived from EigenBase |
| y | matrix to test |
| i | column index to check |
true if column index is in bounds Definition at line 20 of file is_column_index.hpp.
|
inline |
Return true if the matrix is square and not 0x0, if the matrix is symmetric, diagonals are near 1, positive definite, and no elements are NaN A valid correlation matrix is symmetric, has a unit diagonal (all 1 values), and has all values between -1 and 1 (inclusive).
| EigMat | A type derived from EigenBase with dynamic rows and columns |
| y | Matrix to test |
true if the matrix is square and not 0x0, if the matrix is symmetric, diagonals are near 1, positive definite, and no elements are NaN Definition at line 30 of file is_corr_matrix.hpp.
|
inline |
Returns true if the input is infinite and false otherwise.
Delegates to std::isinf.
| x | Value to test. |
true if the value is infinite. Definition at line 18 of file is_inf.hpp.
|
inline |
Returns 1 if the input's value is infinite and 0 otherwise.
Delegates to is_inf.
| v | Value to test. |
1 if the value is infinite and 0 otherwise. Definition at line 20 of file is_inf.hpp.
|
inline |
Returns 1 if the input's value is infinite and 0 otherwise.
Delegates to is_inf.
| T | inner type of the fvar |
| x | Value to test. |
1 if the value is infinite and 0 otherwise. Definition at line 21 of file is_inf.hpp.
|
inline |
Returns true if the input is an integer and false otherwise.
| x | Value to test. |
true if the value is an integer Definition at line 18 of file is_integer.hpp.
|
inline |
Return true if the specified LDLT factor is invalid.
An LDLT_factor is invalid if it was constructed from a matrix that is not positive definite.
| T | Type matrix of LDLT |
| A | The LDLT factor to check for validity |
true if the LDLT factor is valid Definition at line 21 of file is_ldlt_factor.hpp.
|
inline |
Return true if y is less or equal to high.
This function is vectorized and will check each element of y against each element of high.
| T_y | Type of y |
| T_high | Type of upper bound |
| y | Variable to check |
| high | Upper bound |
true if y is less than or equal to low and if and element of y or high is NaN Definition at line 26 of file is_less_or_equal.hpp.
|
inline |
Return true is matrix is lower triangular.
A matrix x is not lower triangular if there is a non-zero entry x[m, n] with m < n. This function only inspect the upper and triangular portion of the matrix, not including the diagonal.
| EigMat | A type derived from EigenBase with dynamic rows and columns |
| y | Matrix to test |
true is matrix is lower triangular Definition at line 21 of file is_lower_triangular.hpp.
|
inline |
Return true is the specified matrix is finite.
| T | Scalar type of the matrix, requires class method .allFinite() |
| EigMat | A type derived from EigenBase |
| y | Matrix to test |
true if the matrix is finite Definition at line 20 of file is_mat_finite.hpp.
|
inline |
Return true if the two matrices are of the same size.
This function checks the runtime sizes only.
| EigMat1 | A type derived from EigenBase |
| EigMat2 | A type derived from EigenBase |
| y1 | first matrix to test |
| y2 | second matrix to test |
true if the dimensions of the matrices match Definition at line 22 of file is_matching_dims.hpp.
|
inline |
Return true if the two matrices are of the same size.
This function checks the runtime sizes and can also check the static sizes as well. For example, a 4x1 matrix is not the same as a vector with 4 elements.
| check_compile | Whether to check the static sizes |
| EigMat1 | A type derived from EigenBase |
| EigMat2 | A type derived from EigenBase |
| y1 | first matrix to test |
| y2 | second matrix to test |
true if the dimensions of the matrices match Definition at line 41 of file is_matching_dims.hpp.
|
inline |
Return true if two structures are the same size.
This is a top-level sizing function for std::vector where a 2x3 vector returns 2, and a total sizing function for Eigen::Matrix where a 2x3 matrix will return 6.
| T_y1 | Type of the first variable, requires class method .size() |
| T_y2 | Type of the second variable, requires class method .size() |
| y1 | First variable |
| y2 | Second variable |
true if the variable sizes match Definition at line 24 of file is_matching_size.hpp.
|
inline |
Returns true if the input is NaN and false otherwise.
Delegates to std::isnan.
| x | Value to test. |
true if the value is NaN. Definition at line 19 of file is_nan.hpp.
|
inline |
Returns 1 if the input's value is NaN and 0 otherwise.
Delegates to is_nan(double).
| T | type of input |
| v | value to test |
1 if the value is NaN and 0 otherwise. Definition at line 20 of file is_nan.hpp.
|
inline |
Returns 1 if the input's value is NaN and 0 otherwise.
Delegates to is_nan.
| T | inner type of the fvar |
| x | Value to test. |
1 if the value is NaN and 0 otherwise. Definition at line 22 of file is_nan.hpp.
|
inline |
Definition at line 24 of file is_nan.hpp.
|
inline |
Returns true if the input is a nonpositive integer and false otherwise.
| x | Value to test. |
true if the value is an integer Definition at line 18 of file is_nonpositive_integer.hpp.
|
inline |
Returns true if the specified matrix/vector is size nonzero.
| T_y | Type of container, requires class method .size() |
| y | Container to test – matrix/vector |
true if container has size zero Definition at line 15 of file is_nonzero_size.hpp.
|
inline |
Return true if y is not NaN.
This function is vectorized and will check each element of y. If no element is NaN, this function will return true.
| T_y | Type of y |
| y | Variable to check |
true if no element of y is NaN Definition at line 23 of file is_not_nan.hpp.
|
inline |
Return true if the vector is sorted into strictly increasing order.
| T_y | Type of scalar, requires class method .size() |
| y | std::vector to test |
true if vector is sorted in ascending order Definition at line 19 of file is_ordered.hpp.
|
inline |
Return true if the matrix is square or if the matrix has non-zero size, or if the matrix is symmetric, or if it is positive definite, or if no element is NaN.
| EigMat | A type derived from EigenBase with dynamic rows and columns |
| y | Matrix to test |
true if the matrix is square or if the matrix has non-0 size, or if the matrix is symmetric, or if it is positive definite, or if no element is NaN Definition at line 27 of file is_pos_definite.hpp.
|
inline |
Return true if the matrix is positive definite.
| Derived | Derived type of the Eigen::LDLT transform, requires class method .info() and .isPositive() and .vectorD().array() |
| cholesky | Eigen::LDLT to test, whose progenitor must not have any NaN elements |
true if the matrix is positive definite Definition at line 56 of file is_pos_definite.hpp.
|
inline |
Return true if diagonal of the L matrix is positive.
| Derived | Derived type of the Eigen::LLT transform, requires class method .info() and .matrixLLT().diagonal().array() |
| cholesky | Eigen::LLT to test, whose progenitor must not have any NaN elements |
true if diagonal of the L matrix is positive Definition at line 71 of file is_pos_definite.hpp.
|
inline |
Return true if y is positive.
This function is vectorized and will check each element of y.
| T_y | Type of y |
| y | Variable to check |
true if vector contains only positive elements Definition at line 20 of file is_positive.hpp.
|
inline |
Return true if size is positive.
| size | Size value to check |
true if size is not zero or negative Definition at line 34 of file is_positive.hpp.
|
inline |
Return true if y is finite.
This function is vectorized and will check each element of y.
| T_y | Type of y |
| y | Variable to check |
| <code>true</code> | if y is not infinity, -infinity, or NaN |
Definition at line 22 of file is_scal_finite.hpp.
|
inline |
Return true if the provided sizes match.
| T_size1 | Type of size 1 |
| T_size2 | Type of size 2 |
| i | Size of variable 1 |
| j | Size of variable 2 |
true if provided dimensions match Definition at line 17 of file is_size_match.hpp.
|
inline |
Return true if the matrix is square.
This check allows 0x0 matrices.
| EigMat | A type derived from EigenBase |
| y | Matrix to test |
true if matrix is square Definition at line 19 of file is_square.hpp.
|
inline |
Return true if the matrix is square, and no element not on the main diagonal is NaN.
| EigMat | A type derived from EigenBase with dynamic rows and columns |
| y | Matrix to test |
true if the matrix is square, and no element not on the main diagonal is NaN Definition at line 24 of file is_symmetric.hpp.
|
inline |
Returns true if the specified variable is uninitialized.
Arithmetic types are always initialized by definition (the value is not specified).
| T | Type of object to test. |
| x | Object to test. |
true if the specified object is uninitialized. Definition at line 19 of file is_uninitialized.hpp.
|
inline |
Returns true if the specified variable is uninitialized.
This overload of the is_uninitialized() function delegates the return to the is_uninitialized() method on the specified variable.
| x | Object to test. |
true if the specified object is uninitialized. Definition at line 23 of file is_uninitialized.hpp.
|
inline |
Return true if the vector is not a unit vector or if any element is NaN.
A valid unit vector is one where the square elements summed is equal to 1. This function tests that the sum is within the tolerance specified by CONSTRAINT_TOLERANCE. This function only accepts Eigen::Matrix vectors, statically typed vectors, not general matrices with 1 column.
| EigMat | A type derived from EigenBase with 1 compile time row or column |
| theta | Eigen vector to test |
true if the vector is not a unit vector or if any element is NaN Definition at line 28 of file is_unit_vector.hpp.
|
inline |
Return true if specified argument is finite (not infinite and not not-a-number).
Overloads std::isfinite from <cmath> for argument-dependent lookup.
| ADType | type of argument |
| [in] | v | argument |
Definition at line 21 of file isfinite.hpp.
|
inline |
|
inline |
|
inline |
Return true if specified argument is normal.
A number is normal if it is finite, non-zero and not subnormal.
Overloads std::isnormal from <cmath> for argument-dependent lookup.
| ADType | type of argument |
| [in] | v | argument |
Definition at line 21 of file isnormal.hpp.
| void stan::math::jacobian | ( | const F & | f, |
| const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | x, | ||
| Eigen::Matrix< T, Eigen::Dynamic, 1 > & | fx, | ||
| Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | J | ||
| ) |
Definition at line 11 of file jacobian.hpp.
| void stan::math::jacobian | ( | const F & | f, |
| const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | x, | ||
| Eigen::Matrix< double, Eigen::Dynamic, 1 > & | fx, | ||
| Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > & | J | ||
| ) |
Definition at line 14 of file jacobian.hpp.
| Eigen::VectorXd stan::math::kinsol_solve | ( | const F1 & | f, |
| const Eigen::VectorXd & | x, | ||
| const double | scaling_step_tol, | ||
| const double | function_tolerance, | ||
| const int64_t | max_num_steps, | ||
| const bool | custom_jacobian, | ||
| const int | steps_eval_jacobian, | ||
| const int | global_line_search, | ||
| std::ostream *const | msgs, | ||
| const Args &... | args | ||
| ) |
Return the solution to the specified algebraic system, given an initial guess.
Invokes the Kinsol solver from Sundials.
| F | type of equation system function. |
| T | type of initial guess vector. |
| [in] | f | Functor that evaluated the system of equations. |
| [in] | x | Vector of starting values. |
| [in] | y | Parameter vector for the equation system. The function is overloaded to treat y as a vector of doubles or of a a template type T. |
| [in] | dat | Continuous data vector for the equation system. |
| [in] | dat_int | Integer data vector for the equation system. |
| [in,out] | msgs | The print stream for warning messages. |
| [in] | scaling_step_tol | Scaled-step stopping tolerance. If a Newton step is smaller than the scaling step tolerance, the code breaks, assuming the solver is no longer making significant progress (i.e. is stuck) |
| [in] | function_tolerance | determines whether roots are acceptable. |
| [in] | max_num_steps | Maximum number of function evaluations. |
| [in] | custom_jacobian | If 0, use Kinsol's default to compute the jacobian for the Newton step, namely Quotient Difference (finite difference). If 1, use reverse-mode AD, unless the user specifies their own method. |
| [in] | J_f | A functor that computes the Jacobian for the Newton step. Defaults to reverse-mode AD. |
| [in] | steps_eval_jacobian | Maximum number of steps before the Jacobian gets recomputed. Note that Kinsol's default is 10. If equal to 1, the algorithm computes exact Newton steps. |
| [in] | global_line_search | does the solver use a global line search? If equal to KIN_NONE, no, if KIN_LINESEARCH, yes. |
| <code>std::invalid_argument</code> | if Kinsol returns a negative flag when setting up the solver. |
| <code>std::domain_error</code> | if Kinsol fails to solve equation in max_num_steps iterations. |
| <code>std::runtime_error</code> | if Kinsol returns a negative flag that is not due to hitting max_num_steps. |
Definition at line 59 of file kinsol_solve.hpp.
Definition at line 13 of file lambert_w.hpp.
|
inline |
Compute the Lambert W function on W0 branch for a value x.
| T | type of value |
| x | value |
| std::domain_error | if x is less than or equal to -e^(-1) |
Definition at line 21 of file lambert_w.hpp.
|
inline |
Return the Lambert W function on W0 branch applied to the specified variable.
| T | Arithmetic or a type inheriting from EigenBase. |
| a | Variable argument. |
Definition at line 22 of file lambert_w.hpp.
|
inline |
Vectorized version of lambert_w0().
| T | type of container |
| x | container |
| std::domain_error | if x is less than or equal to -e^(-1) |
Definition at line 83 of file lambert_w.hpp.
Definition at line 19 of file lambert_w.hpp.
|
inline |
Compute the Lambert W function on W-1 branch for a value x.
| T | type of value |
| x | value |
| std::domain_error | if x is less than or equal to -e^(-1) or greater than or equal to 0 |
Definition at line 35 of file lambert_w.hpp.
|
inline |
Return the Lambert W function on W-1 branch applied to the specified variable.
| T | Arithmetic or a type inheriting from EigenBase. |
| a | Variable argument. |
Definition at line 40 of file lambert_w.hpp.
|
inline |
Vectorized version of lambert_wm1().
| T | type of container |
| x | container |
| std::domain_error | if x is less than or equal to -e^(-1) or greater than or equal to 0 |
Definition at line 98 of file lambert_w.hpp.
|
inline |
Return the lower-bounded value for the specified unconstrained input and specified lower bound.
Specialization of lb_constrain to apply a matrix of lower bounds elementwise to each input element.
The transform applied is
\(f(x) = \exp(x) + L\)
where \(L\) is the constant lower bound.
| T | kernel generator expression |
| L | kernel generator expression |
| [in] | x | unconstrained input |
| [in] | lb | lower bound |
| T | A type inheriting from EigenBase. |
| L | A type inheriting from EigenBase. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
Definition at line 32 of file lb_constrain.hpp.
|
inline |
Return the lower-bounded value for the specified unconstrained input and specified lower bound.
Specialization of lb_constrain to apply a matrix of lower bounds elementwise to each input element.
The transform applied is
\(f(x) = \exp(x) + L\)
where \(L\) is the constant lower bound.
| T | Scalar. |
| L | Scalar. |
| [in] | x | Unconstrained input |
| [in] | lb | Lower bound |
The transform applied is
\(f(x) = \exp(x) + L\)
where \(L\) is the constant lower bound.
If the lower bound is negative infinity, this function reduces to identity_constrain(x).
| T | Scalar |
| L | Scalar |
| [in] | x | Unconstrained input |
| [in] | lb | lower bound on constrained output |
| T | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| L | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
Definition at line 37 of file lb_constrain.hpp.
|
inline |
Return the lower-bounded value for the specified unconstrained input and specified lower bound.
The transform applied is
\(f(x) = \exp(x) + L\)
where \(L\) is the constant lower bound.
| T_x | type of unconstrained input |
| T_lb | type of lower bound |
| [in] | x | unconstrained input |
| [in] | lb | lower bound |
Definition at line 39 of file lb_constrain.hpp.
|
inline |
Return the lower-bounded value for the specified unconstrained input and specified lower bound.
Specialization of lb_constrain to apply a matrix of lower bounds elementwise to each input element.
Return the lower-bounded value for the specified unconstrained input and specified lower bound, incrementing the specified reference with the log absolute Jacobian determinant of the transform.
The transform applied is
\(f(x) = \exp(x) + L\)
where \(L\) is the constant lower bound.
| T | kernel generator expression |
| L | kernel generator expression |
| [in] | x | unconstrained input |
| [in] | lb | lower bound |
| [in,out] | lp | reference to log probability to increment |
| T | Scalar. |
| L | Scalar. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
| [in,out] | lp | reference to log probability to increment |
| T | A type inheriting from EigenBase. |
| L | A type inheriting from EigenBase. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
| [in,out] | lp | reference to log probability to increment |
| T | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| L | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 60 of file lb_constrain.hpp.
|
inline |
Return the lower-bounded value for the specified unconstrained input and specified lower bound.
The transform applied is
\(f(x) = \exp(x) + L\)
where \(L\) is the constant lower bound.
| T_x | type of unconstrained input |
| T_lb | type of lower bound |
| [in] | x | unconstrained input |
| [in] | lb | lower bound |
| [in,out] | lp | reference to log probability to increment |
Definition at line 75 of file lb_constrain.hpp.
|
inline |
Specialization of lb_constrain to apply a scalar lower bound elementwise to each input.
| T | A type inheriting from EigenBase. |
| L | Scalar. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
Definition at line 82 of file lb_constrain.hpp.
|
inline |
Return the lower-bounded value for the specified unconstrained input and specified lower bound.
The transform applied is
\(f(x) = \exp(x) + L\)
where \(L\) is the constant lower bound.
If the lower bound is negative infinity, this function reduces to identity_constrain(x).
| T | Scalar |
| L | Scalar |
| [in] | x | Unconstrained input |
| [in] | lb | lower bound on constrained output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 92 of file lb_constrain.hpp.
|
inline |
Specialization of lb_constrain to apply a scalar lower bound elementwise to each input.
| T | A type inheriting from EigenBase. |
| L | Scalar. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
| [in,out] | lp | reference to log probability to increment |
| T | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| L | Scalar. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 100 of file lb_constrain.hpp.
|
inline |
Specialization of lb_constrain to apply a scalar lower bound elementwise to each input.
| T | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| L | Scalar. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
Definition at line 135 of file lb_constrain.hpp.
|
inline |
Specialization of lb_constrain to apply a container of lower bounds elementwise to each input element.
| T | A Any type with a Scalar scalar_type. |
| L | A type inheriting from EigenBase or a scalar. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
Definition at line 153 of file lb_constrain.hpp.
|
inline |
Specialization of lb_constrain to apply a container of lower bounds elementwise to each input element.
| T | A Any type with a Scalar scalar_type. |
| L | A type inheriting from EigenBase or a standard vector. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 173 of file lb_constrain.hpp.
|
inline |
Specialization of lb_constrain to apply a container of lower bounds elementwise to each input element.
| T | A Any type with a Scalar scalar_type. |
| L | A type inheriting from EigenBase or a standard vector. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
Definition at line 193 of file lb_constrain.hpp.
|
inline |
Specialization of lb_constrain to apply a container of lower bounds elementwise to each input element.
| T | A Any type with a Scalar scalar_type. |
| L | A type inheriting from EigenBase or a standard vector. |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 214 of file lb_constrain.hpp.
|
inline |
Specialization of lb_constrain to apply a container of lower bounds elementwise to each input element.
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| L | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| [in] | x | unconstrained input |
| [in] | lb | lower bound on output |
| [in,out] | lp | log density accumulator |
Definition at line 243 of file lb_constrain.hpp.
|
inline |
Return the unconstrained value that produces the specified lower-bound constrained value.
| T | type of bounded object |
| L | type of lower bound |
| [in] | y | input object |
| [in] | lb | lower bound |
| std::domain_error | if y is lower than the lower bound |
Definition at line 30 of file lb_free.hpp.
|
inline |
Return the free matrix that corresponds to the specified lower-bounded matrix with respect to the specified lower bound.
The transform is the reverse of the lb_constrain transform.
| T | type of matrix |
| L | type of lower bound |
| y | constrained matrix with specified lower bound |
| lb | lower bound |
| std::invalid_argument | if any element of constrained variable is greater than the lower bound. |
Definition at line 57 of file lb_free.hpp.
|
inline |
Return the free variable that corresponds to the specified lower-bounded variable with respect to the specified lower bound.
The transform is the reverse of the lb_constrain transform.
| T | type of constrained variable |
| L | type of lower bound |
| y | constrained variable with specified lower bound |
| lb | lower bound |
| std::invalid_argument | if any element of constrained variable is greater than the lower bound. |
Definition at line 84 of file lb_free.hpp.
|
inline |
Return the free variable that corresponds to the specified lower-bounded variable with respect to the specified lower bound.
The transform is the reverse of the lb_constrain transform.
| T | type of constrained variable |
| L | type of lower bound |
| y | constrained variable with specified lower bound |
| lb | lower bound |
| std::invalid_argument | if any element of constrained variable is greater than the lower bound. |
Definition at line 107 of file lb_free.hpp.
|
inline |
Returns the natural logarithm of the beta function and its gradients.
\[ \mathrm{lbeta}(a,b) = \ln\left(B\left(a,b\right)\right) \]
\[ \frac{\partial }{\partial a} = \psi^{\left(0\right)}\left(a\right) - \psi^{\left(0\right)}\left(a + b\right) \]
\[ \frac{\partial }{\partial b} = \psi^{\left(0\right)}\left(b\right) - \psi^{\left(0\right)}\left(a + b\right) \]
| a | var Argument |
| b | var Argument |
| return_type_t<T1, T2> stan::math::lbeta | ( | const T1 | a, |
| const T2 | b | ||
| ) |
Return the log of the beta function applied to the specified arguments.
The beta function is defined for \(a > 0\) and \(b > 0\) by
\(\mbox{B}(a, b) = \frac{\Gamma(a) \Gamma(b)}{\Gamma(a+b)}\).
This function returns its log,
\(\log \mbox{B}(a, b) = \log \Gamma(a) + \log \Gamma(b) - \log \Gamma(a+b)\).
See stan::math::lgamma() for the double-based and stan::math for the variable-based log Gamma function. This function is numerically more stable than naive evaluation via lgamma.
\[ \mbox{lbeta}(\alpha, \beta) = \begin{cases} \ln\int_0^1 u^{\alpha - 1} (1 - u)^{\beta - 1} \, du & \mbox{if } \alpha, \beta>0 \\[6pt] \textrm{NaN} & \mbox{if } \alpha = \textrm{NaN or } \beta = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{lbeta}(\alpha, \beta)}{\partial \alpha} = \begin{cases} \Psi(\alpha)-\Psi(\alpha+\beta) & \mbox{if } \alpha, \beta>0 \\[6pt] \textrm{NaN} & \mbox{if } \alpha = \textrm{NaN or } \beta = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{lbeta}(\alpha, \beta)}{\partial \beta} = \begin{cases} \Psi(\beta)-\Psi(\alpha+\beta) & \mbox{if } \alpha, \beta>0 \\[6pt] \textrm{NaN} & \mbox{if } \alpha = \textrm{NaN or } \beta = \textrm{NaN} \end{cases} \]
| T1 | type of first value |
| T2 | type of second value |
| a | First value |
| b | Second value |
Returns the natural logarithm of the beta function and its gradients.
\[ \mathrm{lbeta}(a,b) = \ln\left(B\left(a,b\right)\right) \]
\[ \frac{\partial }{\partial a} = \psi^{\left(0\right)}\left(a\right) - \psi^{\left(0\right)}\left(a + b\right) \]
| a | var Argument |
| b | double Argument |
Returns the natural logarithm of the beta function and its gradients.
\[ \mathrm{lbeta}(a,b) = \ln\left(B\left(a,b\right)\right) \]
\[ \frac{\partial }{\partial b} = \psi^{\left(0\right)}\left(b\right) - \psi^{\left(0\right)}\left(a + b\right) \]
| a | double Argument |
| b | var Argument |
|
inline |
Enables the vectorised application of the lbeta function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
|
inline |
|
inline |
Returns the elementwise ldexp() of the input var_value<matrix_cl<double>> and kernel generator expression.
| a | input rev kernel generator expression representing significands |
| b | input kernel generator expression representing the integer exponents. |
ldexp() of the input argument.
|
inline |
Enables the vectorised application of the ldexp function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
|
inline |
Returns the elementwise lgamma() of a var_value<matrix_cl<double>>.
| A | argument |
lgamma() of the input. Definition at line 20 of file lgamma.hpp.
Return the natural logarithm of the gamma function applied to the specified argument.
| T | inner type of the fvar |
| x | Argument. |
Definition at line 21 of file lgamma.hpp.
|
inline |
The log gamma function for variables (C99).
The derivative is the digamma function,
\(\frac{d}{dx} \Gamma(x) = \psi^{(0)}(x)\).
| T | Arithmetic or a type inheriting from EigenBase. |
| a | The variable. |
Definition at line 24 of file lgamma.hpp.
|
inline |
Return the natural logarithm of the gamma function applied to the specified argument.
\[ \mbox{lgamma}(x) = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \ln\Gamma(x) & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{lgamma}(x)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \Psi(x) & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| x | argument |
Definition at line 63 of file lgamma.hpp.
|
inline |
Return the natural logarithm of the gamma function applied to the specified argument.
| x | argument |
Definition at line 82 of file lgamma.hpp.
|
inline |
Vectorized version of lgamma().
| T | type of container |
| x | container |
| std::domain_error | if any value is a negative integer or 0. |
Definition at line 119 of file lgamma.hpp.
| return_type_t<T> stan::math::lgamma_stirling | ( | const T | x | ) |
Return the Stirling approximation to the lgamma function.
\[ \mbox{lgamma_stirling}(x) = \frac{1}{2} \log(2\pi) + (x-\frac{1}{2})*\log(x) - x \]
| T | type of value |
| x | value |
Definition at line 26 of file lgamma_stirling.hpp.
| return_type_t<T> stan::math::lgamma_stirling_diff | ( | const T | x | ) |
Return the difference between log of the gamma function and its Stirling approximation.
This is useful to stably compute log of ratios of gamma functions with large arguments where the Stirling approximation allows for analytic solution and the (small) differences can be added afterwards. This is for example used in the implementation of lbeta.
The function will return correct value for all arguments, but using it can lead to a loss of precision when x < lgamma_stirling_diff_useful.
\[ \mbox{lgamma_stirling_diff}(x) = \log(\Gamma(x)) - \frac{1}{2} \log(2\pi) + (x-\frac{1}{2})*\log(x) - x \]
| T | type of value |
| x | value |
Definition at line 43 of file lgamma_stirling_diff.hpp.
|
inline |
Return an array of linearly spaced elements.
This produces an array from low to high (inclusive) with elements spaced as (high - low) / (K - 1). For K=1, the array will contain the high value; for K=0 it returns an empty array.
| K | size of the array |
| low | smallest value |
| high | largest value |
| std::domain_error | if K is negative, if low is nan or infinite, if high is nan or infinite, or if high is less than low. |
Definition at line 26 of file linspaced_array.hpp.
|
inline |
Return an array of linearly spaced integers.
This produces an array from low to high (inclusive). If high - low is greater or equal to K - 1, then the integers are evenly spaced. If it is not possible to get from low to high with a multiple of an integer, high is lowered until this is possible.
If K - 1 is greater than high - low, then integers are repeated. For instance, low, low, low + 1, low + 1, .... high is lowered until K - 1 is a multiple of high - low
For K = 1, the array will contain the high value. For K = 0 it returns an empty array.
| K | size of the array |
| low | smallest value |
| high | largest value |
| std::domain_error | if K is negative or high is less than low. |
Definition at line 33 of file linspaced_int_array.hpp.
|
inline |
Return a row vector of linearly spaced elements.
This produces a row vector from low to high (inclusive) with elements spaced as (high - low) / (K - 1). For K=1, the vector will contain the high value; for K=0 it returns an empty vector.
| K | size of the row vector |
| low | smallest value |
| high | largest value |
| std::domain_error | if K is negative, if low is nan or infinite, if high is nan or infinite, or if high is less than low. |
Definition at line 25 of file linspaced_row_vector.hpp.
|
inline |
Return a vector of linearly spaced elements.
This produces a vector from low to high (inclusive) with elements spaced as (high - low) / (K - 1). For K=1, the vector will contain the high value; for K=0 it returns an empty vector.
| K | size of the vector |
| low | smallest value |
| high | largest value |
| std::domain_error | if K is negative, if low is nan or infinite, if high is nan or infinite, or if high is less than low. |
Definition at line 25 of file linspaced_vector.hpp.
| return_type_t<T_covar, T_shape> stan::math::lkj_corr_cholesky_lpdf | ( | const T_covar & | L, |
| const T_shape & | eta | ||
| ) |
Definition at line 18 of file lkj_corr_cholesky_lpdf.hpp.
|
inline |
Definition at line 56 of file lkj_corr_cholesky_lpdf.hpp.
|
inline |
Definition at line 13 of file lkj_corr_cholesky_rng.hpp.
| return_type_t<T_y, T_shape> stan::math::lkj_corr_lpdf | ( | const T_y & | y, |
| const T_shape & | eta | ||
| ) |
Definition at line 49 of file lkj_corr_lpdf.hpp.
|
inline |
Definition at line 80 of file lkj_corr_lpdf.hpp.
| return_type_t< T_y, T_loc, T_scale, T_shape > stan::math::lkj_cov_lpdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma, | ||
| const T_shape & | eta | ||
| ) |
|
inline |
Definition at line 100 of file lkj_cov_lpdf.hpp.
|
inline |
Definition at line 14 of file lmgamma.hpp.
Definition at line 27 of file lmgamma.hpp.
|
inline |
Return the natural logarithm of the multivariate gamma function with the specified dimensions and argument.
The multivariate gamma function \(\Gamma_k(x)\) for dimensionality \(k\) and argument \(x\) is defined by
\(\Gamma_k(x) = \pi^{k(k-1)/4} \, \prod_{j=1}^k \Gamma(x + (1 - j)/2)\),
where \(\Gamma()\) is the gamma function.
\[ \mbox{lmgamma}(n, x) = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \ln\Gamma_n(x) & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{lmgamma}(n, x)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \frac{\partial\, \ln\Gamma_n(x)}{\partial x} & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \ln\Gamma_n(x) = \pi^{n(n-1)/4} \, \prod_{j=1}^n \Gamma(x + (1 - j)/2) \]
\[ \frac{\partial \, \ln\Gamma_n(x)}{\partial x} = \sum_{j=1}^n \Psi(x + (1 - j) / 2) \]
| T | type of scalar |
| k | Number of dimensions. |
| x | Function argument. |
Definition at line 55 of file lmgamma.hpp.
|
inline |
Enables the vectorised application of the natural log of the multivariate gamma function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 73 of file lmgamma.hpp.
|
inline |
Definition at line 13 of file lmultiply.hpp.
Definition at line 20 of file lmultiply.hpp.
|
inline |
Return the first argument times the log of the second argument.
The result is 0 if both arguments are 0. The funcgtion is defined by lmultiply(x, y) = x * log(y) if x or y is non-zero and lmultiply(0, 0) = 0 otherwise.
| T1 | type of the first argument |
| T2 | type of the second argument |
| a | first argument |
| b | second argument |
Definition at line 25 of file lmultiply.hpp.
Definition at line 26 of file lmultiply.hpp.
|
inline |
Returns the elementwise lmultiply() of the input.
| T_a | type of first expression |
| T_b | type of second expression |
| a | first expression |
| b | second expression |
lmultiply() of the input. Definition at line 28 of file lmultiply.hpp.
|
inline |
Return the result of applying lmultiply to the arguments elementwise, with broadcasting if one of the arguments is a scalar.
Return the product a * log(b).
Return the elementwise product a * log(b).
At least one of the arguments must be a container.
| T1 | type of the first argument |
| T2 | type of the second argument |
| a | first argument |
| b | second argument |
lmultiply to the argumentsBoth T1 and T2 are matrices, and one of T1 or T2 must be a var_value
| T1 | Type of first argument |
| T2 | Type of second argument |
| a | First argument |
| b | Second argument |
a and log(b)| T1 | Type of matrix argument |
| T2 | Type of scalar argument |
| a | Matrix argument |
| b | Scalar argument |
a and log(b)| T1 | Type of scalar argument |
| T2 | Type of matrix argument |
| a | Scalar argument |
| b | Matrix argument |
a and log(b) Definition at line 46 of file lmultiply.hpp.
Return the value of a*log(b).
When both a and b are 0, the value returned is 0. The partial derivative with respect to a is log(b). The partial derivative with respect to b is a/b.
| a | First variable. |
| b | Second variable. |
Definition at line 57 of file lmultiply.hpp.
Return the value of a*log(b).
When both a and b are 0, the value returned is 0. The partial derivative with respect to a is log(b).
| a | First variable. |
| b | Second scalar. |
Definition at line 70 of file lmultiply.hpp.
Return the value of a*log(b).
When both a and b are 0, the value returned is 0. The partial derivative with respect to b is a/b.
| a | First scalar. |
| b | Second variable. |
Definition at line 83 of file lmultiply.hpp.
|
inline |
Return the elementwise natural log of the specified argument, which may be a scalar or any Stan container of numeric scalars.
The return type is the same as the argument type.
| Container | type of container |
| [in] | x | container |
|
inline |
Return the natural log of the specified variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \log x = \frac{1}{x}\).
\[ \mbox{log}(x) = \begin{cases} \textrm{NaN} & \mbox{if } x < 0\\ \ln(x) & \mbox{if } x \geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log}(x)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < 0\\ \frac{1}{x} & \mbox{if } x\geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| T | Arithmetic or a type inheriting from EigenBase. |
| a | Variable whose log is taken. |
|
inline |
|
inline |
|
inline |
Return the base 10 log of the specified variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \log_{10} x = \frac{1}{x \log 10}\).
\[ \mbox{log10}(x) = \begin{cases} \textrm{NaN} & \mbox{if } x < 0\\ \log_{10}(x) & \mbox{if } x \geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log10}(x)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < 0\\ \frac{1}{x \ln10} & \mbox{if } x\geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| T | Arithmetic or a type inheriting from EigenBase. |
| a | Variable whose log is taken. |
|
inline |
|
inlinestatic |
Returns the natural logarithm of ten.
Definition at line 228 of file constants.hpp.
|
inline |
The log (1 - x) function for variables.
The derivative is given by
\(\frac{d}{dx} \log (1 - x) = -\frac{1}{1 - x}\).
| T | Arithmetic or a type inheriting from EigenBase. |
| a | The variable. |
|
inline |
Return the natural logarithm of one minus the specified value.
The main use of this function is to cut down on intermediate values during algorithmic differentiation.
\[ \mbox{log1m}(x) = \begin{cases} \ln(1-x) & \mbox{if } x \leq 1 \\ \textrm{NaN} & \mbox{if } x > 1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log1m}(x)}{\partial x} = \begin{cases} -\frac{1}{1-x} & \mbox{if } x \leq 1 \\ \textrm{NaN} & \mbox{if } x > 1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| [in] | x | Argument. |
| <code>std::domain_error</code> | If the argument is greater than 1. |
| <code>std::overflow_error</code> | If the computation overflows. |
|
inline |
|
inline |
Returns the elementwise log1m_exp() of a var_value<matrix_cl<double>>.
| A | argument |
log1m_exp() of the input. Definition at line 20 of file log1m_exp.hpp.
Return the natural logarithm of one minus the exponentiation of the specified argument.
| T | inner type of the fvar |
| x | Argument. |
Definition at line 23 of file log1m_exp.hpp.
|
inline |
Return the log of 1 minus the exponential of the specified variable.
The derivative of log(1 - exp(x)) with respect to x is -1 / expm1(-x).
| T | Arithmetic or a type inheriting from EigenBase. |
| [in] | x | Argument. |
Definition at line 25 of file log1m_exp.hpp.
|
inline |
Calculates the natural logarithm of one minus the exponential of the specified value without overflow,.
log1m_exp(x) = log(1-exp(x))
This function is only defined for x < 0
\[ \mbox{log1m\_exp}(x) = \begin{cases} \ln(1-\exp(x)) & \mbox{if } x < 0 \\ \textrm{NaN} & \mbox{if } x \geq 0\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{asinh}(x)}{\partial x} = \begin{cases} -\frac{\exp(x)}{1-\exp(x)} & \mbox{if } x < 0 \\ \textrm{NaN} & \mbox{if } x \geq 0\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| [in] | a | Argument. |
Definition at line 47 of file log1m_exp.hpp.
|
inline |
Vectorized version of log1m_exp().
| T | type of container |
| x | container |
Definition at line 83 of file log1m_exp.hpp.
Return the natural logarithm of one minus the inverse logit of the specified argument.
| T | inner type of the fvar |
| x | argument |
Definition at line 21 of file log1m_inv_logit.hpp.
|
inline |
Returns the elementwise log1m_inv_logit() of a var_value<matrix_cl<double>>.
| A | argument |
log1m_inv_logit() of the input. Definition at line 21 of file log1m_inv_logit.hpp.
|
inline |
Return the natural logarithm of one minus the inverse logit of the specified argument.
| T | Arithmetic or a type inheriting from EigenBase. |
| u | argument |
Definition at line 21 of file log1m_inv_logit.hpp.
|
inline |
Returns the natural logarithm of 1 minus the inverse logit of the specified argument.
\[ \mbox{log1m\_inv\_logit}(x) = \begin{cases} -\ln(\exp(x)+1) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log1m\_inv\_logit}(x)}{\partial x} = \begin{cases} -\frac{\exp(x)}{\exp(x)+1} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| u | argument |
Definition at line 36 of file log1m_inv_logit.hpp.
|
inline |
Return the natural logarithm of one minus the inverse logit of the specified argument.
| u | argument |
Definition at line 51 of file log1m_inv_logit.hpp.
|
inline |
Return the elementwise application of log1m_inv_logit() to specified argument container.
The return type promotes the underlying scalar argument type to double if it is an integer, and otherwise is the argument type.
| T | type of container |
| x | container |
Definition at line 86 of file log1m_inv_logit.hpp.
|
inline |
|
inline |
Return the natural logarithm of one plus the specified value.
\[ \mbox{log1p}(x) = \log(1 + x) \]
This version is more stable for arguments near zero than the direct definition. If x == -1, log1p(x) is defined to be negative infinity.
| [in] | x | Argument. |
| std::domain_error | If argument is less than -1. |
|
inline |
Return the natural logarithm of one plus the specified argument.
This version is required to disambiguate log1p(int).
| [in] | x | Argument. |
| std::domain_error | If argument is less than -1. |
|
inline |
Return the elementwise application of log1p() to specified argument container.
The return type promotes the underlying scalar argument type to double if it is an integer, and otherwise is the argument type.
| T | type of container |
| x | container |
Definition at line 13 of file log1p_exp.hpp.
|
inline |
Return the log of 1 plus the exponential of the specified variable.
| T | Arithmetic or a type inheriting from EigenBase. |
| a | The variable. |
Definition at line 19 of file log1p_exp.hpp.
|
inline |
Returns the elementwise log1p_exp() of a var_value<matrix_cl<double>>.
| A | argument |
log1p_exp() of the input. Definition at line 20 of file log1p_exp.hpp.
|
inline |
Calculates the log of 1 plus the exponential of the specified value without overflow.
This function is related to other special functions by:
log1p_exp(x)
= log1p(exp(a))
= log(1 + exp(x))
= log_sum_exp(0, x).
\[ \mbox{log1p\_exp}(x) = \begin{cases} \ln(1+\exp(x)) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log1p\_exp}(x)}{\partial x} = \begin{cases} \frac{\exp(x)}{1+\exp(x)} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
Definition at line 45 of file log1p_exp.hpp.
|
inline |
Vectorized version of log1p_exp().
| T | type of container |
| x | container |
Definition at line 78 of file log1p_exp.hpp.
|
inline |
|
inline |
Returns the base 2 logarithm of the specified variable (C99).
See log2() for the double-based version.
The derivative is
\(\frac{d}{dx} \log_2 x = \frac{1}{x \log 2}\).
\[ \mbox{log2}(x) = \begin{cases} \textrm{NaN} & \mbox{if } x < 0 \\ \log_2(x) & \mbox{if } x\geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log2}(x)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < 0 \\ \frac{1}{x\ln2} & \mbox{if } x\geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| T | Arithmetic or a type inheriting from EigenBase. |
| a | The variable. |
|
inline |
Return the elementwise application of log2() to specified argument container.
The return type promotes the underlying scalar argument type to double if it is an integer, and otherwise is the argument type.
| T | type of container |
| x | container |
|
inline |
Definition at line 14 of file log_determinant.hpp.
|
inline |
Returns the log absolute determinant of the specified square matrix.
| EigMat | type of the matrix |
| m | Specified matrix. |
| std::domain_error | if matrix is not square. |
Definition at line 16 of file log_determinant.hpp.
|
inline |
Returns log(abs(det(A))) given a LDLT_factor of A.
| T | type of elements in the LDLT_factor |
| A | LDLT_factor |
Definition at line 17 of file log_determinant_ldlt.hpp.
| var stan::math::log_determinant_ldlt | ( | LDLT_factor< T > & | A | ) |
Returns the log det of the matrix whose LDLT factorization is given.
| T | Type of matrix for LDLT factor |
| A | an LDLT_factor |
Definition at line 21 of file log_determinant_ldlt.hpp.
|
inline |
Returns the log det of a symmetric, positive-definite matrix.
| EigMat | Type of the matrix |
| m | a symmetric, positive-definite matrix |
Definition at line 24 of file log_determinant_spd.hpp.
|
inline |
Returns the log absolute determinant of the specified square matrix.
| T | type of the matrix |
| m | specified matrix |
| std::domain_error | if matrix is not square and symmetric |
Definition at line 25 of file log_determinant_spd.hpp.
|
inline |
Returns the log det of a symmetric, positive-definite matrix.
| EigMat | Type of the matrix |
| m | a symmetric, positive-definite matrix |
Definition at line 74 of file log_determinant_spd.hpp.
|
inline |
Definition at line 14 of file log_diff_exp.hpp.
|
inline |
Definition at line 27 of file log_diff_exp.hpp.
|
inline |
Returns the natural logarithm of the difference of the natural exponentiation of x and the natural exponentiation of y.
| T_x | type of x argument |
| T_y | type of y argument |
| x | first argument |
| y | second argument |
Definition at line 36 of file log_diff_exp.hpp.
|
inline |
Definition at line 38 of file log_diff_exp.hpp.
|
inline |
The natural logarithm of the difference of the natural exponentiation of x and the natural exponentiation of y.
This function is only defined for x >= y
\[ \mbox{log\_diff\_exp}(x, y) = \begin{cases} \textrm{NaN} & \mbox{if } x < y\\ \ln(\exp(x)-\exp(y)) & \mbox{if } x \geq y \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log\_diff\_exp}(x, y)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x \leq y\\ \frac{\exp(x)}{\exp(x)-\exp(y)} & \mbox{if } x > y \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log\_diff\_exp}(x, y)}{\partial y} = \begin{cases} \textrm{NaN} & \mbox{if } x \leq y\\ -\frac{\exp(y)}{\exp(x)-\exp(y)} & \mbox{if } x > y \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| T1 | type of the first argument |
| T2 | type of the second argument |
| x | first argument |
| y | second argument |
Definition at line 51 of file log_diff_exp.hpp.
Returns the log difference of the exponentiated arguments.
| [in] | a | First argument. |
| [in] | b | Second argument. |
Definition at line 56 of file log_diff_exp.hpp.
Returns the log difference of the exponentiated arguments.
| [in] | a | First argument. |
| [in] | b | Second argument. |
Definition at line 67 of file log_diff_exp.hpp.
|
inline |
Enables the vectorised application of the log_diff_exp function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 69 of file log_diff_exp.hpp.
Returns the log difference of the exponentiated arguments.
| [in] | a | First argument. |
| [in] | b | Second argument. |
Definition at line 78 of file log_diff_exp.hpp.
|
inline |
Definition at line 14 of file log_falling_factorial.hpp.
|
inline |
Definition at line 21 of file log_falling_factorial.hpp.
|
inline |
Definition at line 27 of file log_falling_factorial.hpp.
|
inline |
Return the natural log of the falling factorial of the specified arguments.
\[ \mbox{log\_falling\_factorial}(x, n) = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \ln (x)_n & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log\_falling\_factorial}(x, n)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \Psi(x) & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log\_falling\_factorial}(x, n)}{\partial n} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ -\Psi(n) & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
| T1 | type of first argument |
| T2 | type of second argument |
| [in] | x | First argument |
| [in] | n | Second argument |
| std::domain_error | if the first argument is not positive |
Definition at line 55 of file log_falling_factorial.hpp.
Definition at line 61 of file log_falling_factorial.hpp.
Definition at line 65 of file log_falling_factorial.hpp.
Definition at line 69 of file log_falling_factorial.hpp.
|
inline |
Enables the vectorised application of the log_falling_factorial function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 75 of file log_falling_factorial.hpp.
Definition at line 13 of file log_inv_logit.hpp.
Return the natural logarithm of the inverse logit of the specified argument.
| u | argument |
Definition at line 19 of file log_inv_logit.hpp.
|
inline |
Returns the elementwise log_inv_logit() of a var_value<matrix_cl<double>>.
| A | argument |
log_inv_logit() of the input. Definition at line 20 of file log_inv_logit.hpp.
|
inline |
Returns the natural logarithm of the inverse logit of the specified argument.
\[ \mbox{log\_inv\_logit}(x) = \begin{cases} \ln\left(\frac{1}{1+\exp(-x)}\right)& \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log\_inv\_logit}(x)}{\partial x} = \begin{cases} \frac{1}{1+\exp(x)} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| u | argument |
Definition at line 34 of file log_inv_logit.hpp.
|
inline |
Returns the natural logarithm of the inverse logit of the specified argument.
| u | argument |
Definition at line 49 of file log_inv_logit.hpp.
|
inline |
Return the elementwise application of log_inv_logit() to specified argument container.
The return type promotes the underlying scalar argument type to double if it is an integer, and otherwise is the argument type.
| T | type of container |
| x | container |
Definition at line 83 of file log_inv_logit.hpp.
|
inline |
Returns the natural logarithm of the difference of the inverse logits of the specified arguments.
| T_x | type of x argument |
| T_y | type of y argument |
| x | first argument |
| y | second argument |
Definition at line 34 of file log_inv_logit_diff.hpp.
|
inline |
Returns the natural logarithm of the difference of the inverse logits of the specified arguments.
\[ \mathrm{log\_inv\_logit\_diff}(x,y) = \ln\left(\frac{1}{1+\exp(-x)}-\frac{1}{1+\exp(-y)}\right) \]
\[ \frac{\partial }{\partial x} = -\frac{e^x}{e^y-e^x}-\frac{e^x}{e^x+1} \]
\[ \frac{\partial }{\partial x} = -\frac{e^y}{e^x-e^y}-\frac{e^y}{e^y+1} \]
| T1 | type of x argument |
| T2 | type of y argument |
| x | first argument |
| y | second argument |
Definition at line 36 of file log_inv_logit_diff.hpp.
|
inline |
Returns fvar with the natural logarithm of the difference of the inverse logits of the specified arguments and its gradients.
\[ \mathrm{log\_inv\_logit\_diff}(x,y) = \ln\left(\frac{1}{1+\exp(-x)}-\frac{1}{1+\exp(-y)}\right) \]
\[ \frac{\partial }{\partial x} = -\frac{e^x}{e^y-e^x}-\frac{e^x}{e^x+1} \]
\[ \frac{\partial }{\partial x} = -\frac{e^y}{e^x-e^y}-\frac{e^y}{e^y+1} \]
| T | inner type of the fvar |
| x | Argument. |
| y | Argument. |
Definition at line 38 of file log_inv_logit_diff.hpp.
|
inline |
Definition at line 46 of file log_inv_logit_diff.hpp.
|
inline |
Enables the vectorised application of the log_inv_logit_diff function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 51 of file log_inv_logit_diff.hpp.
|
inline |
Definition at line 52 of file log_inv_logit_diff.hpp.
Definition at line 71 of file log_inv_logit_diff.hpp.
Definition at line 75 of file log_inv_logit_diff.hpp.
Definition at line 79 of file log_inv_logit_diff.hpp.
|
inline |
Return the log mixture density with specified mixing proportions and log densities.
\[ \frac{\partial }{\partial p_x} \log\left(\exp^{\log\left(p_1\right)+d_1}+\cdot\cdot\cdot+ \exp^{\log\left(p_n\right)+d_n}\right) =\frac{e^{d_x}}{e^{d_1}p_1+\cdot\cdot\cdot+e^{d_m}p_m} \]
\[ \frac{\partial }{\partial d_x} \log\left(\exp^{\log\left(p_1\right)+d_1}+\cdot\cdot\cdot+ \exp^{\log\left(p_n\right)+d_n}\right) =\frac{e^{d_x}p_x}{e^{d_1}p_1+\cdot\cdot\cdot+e^{d_m}p_m} \]
| T_theta | Type of theta. |
| T_lam | Type of lambda. |
| theta | std/row/col vector of mixing proportions in [0, 1]. |
| lambda | std/row/col vector of log densities. |
Definition at line 39 of file log_mix.hpp.
|
inline |
Return the log mixture density with specified mixing proportion and log densities.
\[ \mbox{log\_mix}(\theta, \lambda_1, \lambda_2) = \log \left( \theta \lambda_1 + (1 - \theta) \lambda_2 \right). \]
| T_theta | type of mixing proportion - must be an arithmetic type |
| T_lambda1 | type of first log density - must be an arithmetic type |
| T_lambda2 | type of second log density - must be an arithmetic type |
| [in] | theta | mixing proportion in [0, 1]. |
| [in] | lambda1 | first log density. |
| [in] | lambda2 | second log density. |
Definition at line 41 of file log_mix.hpp.
| return_type_t<T_theta, T_lam> stan::math::log_mix | ( | const T_theta & | theta, |
| const T_lam & | lambda | ||
| ) |
Return the log mixture density with specified mixing proportions and log densities.
\[ \frac{\partial }{\partial p_x} \log\left(\exp^{\log\left(p_1\right)+d_1}+\cdot\cdot\cdot+ \exp^{\log\left(p_n\right)+d_n}\right) =\frac{e^{d_x}}{e^{d_1}p_1+\cdot\cdot\cdot+e^{d_m}p_m} \]
\[ \frac{\partial }{\partial d_x} \log\left(\exp^{\log\left(p_1\right)+d_1}+\cdot\cdot\cdot+ \exp^{\log\left(p_n\right)+d_n}\right) =\frac{e^{d_x}p_x}{e^{d_1}p_1+\cdot\cdot\cdot+e^{d_m}p_m} \]
| T_theta | Type of theta. This can be a scalar, std vector or row/column vector. |
| T_lam | Type of lambda. This can be a scalar, std vector or row/column vector. |
| theta | std/row/col vector of mixing proportions in [0, 1]. |
| lambda | std/row/col vector of log densities. |
Definition at line 77 of file log_mix.hpp.
|
inline |
Return the log mixture density with specified mixing proportion and log densities and its derivative at each.
\[ \mbox{log\_mix}(\theta, \lambda_1, \lambda_2) = \log \left( \theta \exp(\lambda_1) + (1 - \theta) \exp(\lambda_2) \right). \]
\[ \frac{\partial}{\partial \theta} \mbox{log\_mix}(\theta, \lambda_1, \lambda_2) = \dfrac{\exp(\lambda_1) - \exp(\lambda_2)} {\left( \theta \exp(\lambda_1) + (1 - \theta) \exp(\lambda_2) \right)} \]
\[ \frac{\partial}{\partial \lambda_1} \mbox{log\_mix}(\theta, \lambda_1, \lambda_2) = \dfrac{\theta \exp(\lambda_1)} {\left( \theta \exp(\lambda_1) + (1 - \theta) \exp(\lambda_2) \right)} \]
\[ \frac{\partial}{\partial \lambda_2} \mbox{log\_mix}(\theta, \lambda_1, \lambda_2) = \dfrac{\theta \exp(\lambda_2)} {\left( \theta \exp(\lambda_1) + (1 - \theta) \exp(\lambda_2) \right)} \]
| T_theta | theta scalar type. |
| T_lambda1 | lambda1 scalar type. |
| T_lambda2 | lambda2 scalar type. |
| [in] | theta | mixing proportion in [0, 1]. |
| [in] | lambda1 | first log density. |
| [in] | lambda2 | second log density. |
Definition at line 79 of file log_mix.hpp.
|
inline |
Return the log mixture density with specified mixing proportion and log densities and its derivative at each.
\[ \mbox{log\_mix}(\theta, \lambda_1, \lambda_2) = \log \left( \theta \exp(\lambda_1) + (1 - \theta) \exp(\lambda_2) \right). \]
\[ \frac{\partial}{\partial \theta} \mbox{log\_mix}(\theta, \lambda_1, \lambda_2) = \dfrac{\exp(\lambda_1) - \exp(\lambda_2)} {\left( \theta \exp(\lambda_1) + (1 - \theta) \exp(\lambda_2) \right)} \]
\[ \frac{\partial}{\partial \lambda_1} \mbox{log\_mix}(\theta, \lambda_1, \lambda_2) = \dfrac{\theta \exp(\lambda_1)} {\left( \theta \exp(\lambda_1) + (1 - \theta) \exp(\lambda_2) \right)} \]
\[ \frac{\partial}{\partial \lambda_2} \mbox{log\_mix}(\theta, \lambda_1, \lambda_2) = \dfrac{\theta \exp(\lambda_2)} {\left( \theta \exp(\lambda_1) + (1 - \theta) \exp(\lambda_2) \right)} \]
| T | inner type of the fvar |
| [in] | theta | mixing proportion in [0, 1]. |
| [in] | lambda1 | first log density. |
| [in] | lambda2 | second log density. |
Definition at line 98 of file log_mix.hpp.
|
inline |
Definition at line 118 of file log_mix.hpp.
|
inline |
Definition at line 136 of file log_mix.hpp.
| return_type_t<T_theta, std::vector<T_lam> > stan::math::log_mix | ( | const T_theta & | theta, |
| const std::vector< T_lam > & | lambda | ||
| ) |
Return the log mixture density given specified mixing proportions and array of log density vectors.
\[ \frac{\partial }{\partial p_x}\left[ \log\left(\exp^{\log\left(p_1\right)+d_1}+\cdot\cdot\cdot+ \exp^{\log\left(p_n\right)+d_n}\right)+ \log\left(\exp^{\log\left(p_1\right)+f_1}+\cdot\cdot\cdot+ \exp^{\log\left(p_n\right)+f_n}\right)\right] =\frac{e^{d_x}}{e^{d_1}p_1+\cdot\cdot\cdot+e^{d_m}p_m}+ \frac{e^{f_x}}{e^{f_1}p_1+\cdot\cdot\cdot+e^{f_m}p_m} \]
\[ \frac{\partial }{\partial d_x}\left[ \log\left(\exp^{\log\left(p_1\right)+d_1}+\cdot\cdot\cdot+ \exp^{\log\left(p_n\right)+d_n}\right) +\log\left(\exp^{\log\left(p_1\right)+f_1}+\cdot\cdot\cdot+ \exp^{\log\left(p_n\right)+f_n}\right)\right] =\frac{e^{d_x}p_x}{e^{d_1}p_1+\cdot\cdot\cdot+e^{d_m}p_m} \]
| T_theta | Type of theta. This can be a scalar, std vector or row/column vector |
| T_lam | Type of vector in std vector lambda. This can be std vector or row/column vector. |
| theta | std/row/col vector of mixing proportions in [0, 1]. |
| lambda | std vector containing std/row/col vectors of log densities. |
Definition at line 147 of file log_mix.hpp.
|
inline |
Definition at line 154 of file log_mix.hpp.
|
inline |
Definition at line 173 of file log_mix.hpp.
|
inline |
Definition at line 189 of file log_mix.hpp.
|
inline |
Definition at line 205 of file log_mix.hpp.
|
inline |
Definition at line 24 of file log_mix.hpp.
|
inline |
Definition at line 28 of file log_mix.hpp.
|
inline |
Definition at line 47 of file log_modified_bessel_first_kind.hpp.
|
inline |
Enables the vectorised application of the log_modified_bessel_first_kind function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 234 of file log_modified_bessel_first_kind.hpp.
|
inline |
Definition at line 13 of file log_rising_factorial.hpp.
|
inline |
Definition at line 20 of file log_rising_factorial.hpp.
|
inline |
Definition at line 26 of file log_rising_factorial.hpp.
Definition at line 43 of file log_rising_factorial.hpp.
Definition at line 47 of file log_rising_factorial.hpp.
Definition at line 51 of file log_rising_factorial.hpp.
|
inline |
Return the natural logarithm of the rising factorial from the first specified argument to the second.
\[ \mbox{log\_rising\_factorial}(x, n) = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \ln x^{(n)} & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log\_rising\_factorial}(x, n)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \Psi(x+n) - \Psi(x) & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log\_rising\_factorial}(x, n)}{\partial n} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \Psi(x+n) & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
| T1 | type of first argument x |
| T2 | type of second argument n |
| [in] | x | first argument |
| [in] | n | second argument |
| std::domain_error | if the first argument is not positive |
Definition at line 53 of file log_rising_factorial.hpp.
|
inline |
Enables the vectorised application of the log_rising_factorial function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 73 of file log_rising_factorial.hpp.
|
inline |
Return log of the softmax of the specified vector.
| T | type of the vector |
| [in] | a | vector to transform |
Definition at line 23 of file log_softmax.hpp.
|
inline |
Return log of the softmax of the specified vector.
| T | type of the vector |
| [in] | A | vector |
Definition at line 23 of file log_softmax.hpp.
|
inline |
Return the log softmax of the specified vector or container of vectors.
Return the log softmax of the specified std::vector or std::vector of containers.
Return the log softmax of the specified vector.
| T | Type of input vector or matrix. |
| [in] | x | Unconstrained input vector. |
| std::domain_error | If the input vector is size 0. |
| T | type of input |
| x | input |
| std::domain_error | if the input size is 0 |
Definition at line 23 of file log_softmax.hpp.
|
inline |
Return the natural logarithm of the softmax of the specified vector.
\( \log \mbox{softmax}(y) \ = \ y - \log \sum_{k=1}^K \exp(y_k) \ = \ y - \mbox{log\_sum\_exp}(y). \)
For the log softmax function, the entries in the Jacobian are \( \frac{\partial}{\partial y_m} \mbox{softmax}(y)[k] = \left\{ \begin{array}{ll} 1 - \mbox{softmax}(y)[m] & \mbox{ if } m = k, \mbox{ and} \\[6pt] \mbox{softmax}(y)[m] & \mbox{ if } m \neq k. \end{array} \right. \)
| Container | type of input vector to transform |
| [in] | x | vector to transform |
Definition at line 44 of file log_softmax.hpp.
|
inline |
Definition at line 18 of file log_sum_exp.hpp.
|
inline |
Return the log of the sum of the exponentiated values of the specified matrix of values.
| T | type of the vector |
| [in] | A | vector |
Definition at line 24 of file log_sum_exp.hpp.
Definition at line 26 of file log_sum_exp.hpp.
|
inline |
Return the log of the sum of the exponentiated values of the specified matrix of values.
The matrix may be a full matrix, a vector, a row vector.
The function is defined as follows to prevent overflow in exponential calculations.
\(\log \sum_{n=1}^N \exp(x_n) = \max(x) + \log \sum_{n=1}^N \exp(x_n - \max(x))\).
| T | type of input vector or matrix |
| [in] | a | matrix of specified values |
Definition at line 31 of file log_sum_exp.hpp.
Definition at line 35 of file log_sum_exp.hpp.
Returns the log sum of exponentials.
Definition at line 45 of file log_sum_exp.hpp.
|
inline |
Calculates the log sum of exponentials without overflow.
\(\log (\exp(a) + \exp(b)) = m + \log(\exp(a-m) + \exp(b-m))\),
where \(m = max(a, b)\).
\[ \mbox{log\_sum\_exp}(x, y) = \begin{cases} \ln(\exp(x)+\exp(y)) & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log\_sum\_exp}(x, y)}{\partial x} = \begin{cases} \frac{\exp(x)}{\exp(x)+\exp(y)} & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log\_sum\_exp}(x, y)}{\partial y} = \begin{cases} \frac{\exp(y)}{\exp(x)+\exp(y)} & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| T1 | type of the first variable |
| T2 | type of the second variable |
| a | the first variable |
| b | the second variable |
Definition at line 51 of file log_sum_exp.hpp.
Returns the log sum of exponentials.
Definition at line 51 of file log_sum_exp.hpp.
|
inline |
Return the log of the sum of the exponentiated values of the specified matrix of values.
Returns the log sum of exponentials.
The matrix may be a full matrix, a vector, a row vector, or a container of these.
The function is defined as follows to prevent overflow in exponential calculations.
\(\log \sum_{n=1}^N \exp(x_n) = \max(x) + \log \sum_{n=1}^N \exp(x_n - \max(x))\).
| T | Type of input vector or matrix. |
| [in] | x | Matrix of specified values. |
The matrix may be a full matrix, a vector, a row vector, or a container of these.
The function is defined as follows to prevent overflow in exponential calculations.
\(\log \sum_{n=1}^N \exp(x_n) = \max(x) + \log \sum_{n=1}^N \exp(x_n - \max(x))\).
| T | type of input vector or matrix |
| [in] | x | matrix of specified values |
| T | Type of input vector or matrix. |
| x | matrix |
Definition at line 55 of file log_sum_exp.hpp.
Returns the log sum of exponentials.
Definition at line 57 of file log_sum_exp.hpp.
|
inline |
Returns the log sum of exponentials of the input.
| T | A type inheriting from EigenBase with scalar type var |
| v | input |
Definition at line 69 of file log_sum_exp.hpp.
|
inline |
Returns the log sum of exponentials of the input.
| T | A var_value with an input vector or matrix |
| x | input |
Definition at line 89 of file log_sum_exp.hpp.
| double stan::math::logb | ( | const T & | x | ) |
Returns the value of the unbiased radix-independent exponent from the floating-point argument.
Implementation note: This implementation works for all autodiff types because it is a step function, so can return a double which will produce the correct zero derivative if promoted to an autodiff variable.
| T | floating-point type |
| [in] | x | floating-point argument |
|
inline |
The logical and function which returns 1 if both arguments are unequal to zero and 0 otherwise.
Equivalent to x1 != 0 && x2 != 0.
\[ \mbox{operator\&\&}(x, y) = \begin{cases} 0 & \mbox{if } x = 0 \textrm{ or } y=0 \\ 1 & \mbox{if } x, y \neq 0 \\[6pt] 1 & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| T1 | type of first argument |
| T2 | type of second argument |
| x1 | first argument |
| x2 | second argument |
true if both x1 and x2 are not equal to 0. Definition at line 30 of file logical_and.hpp.
|
inline |
Return 1 if the first argument is equal to the second.
Equivalent to x1 == x2.
| T1 | type of first argument |
| T2 | type of second argument |
| x1 | first argument |
| x2 | second argument |
true iff x1 == x2 Definition at line 19 of file logical_eq.hpp.
|
inline |
Return 1 if the first argument is strictly greater than the second.
Equivalent to x1 < x2.
| T1 | type of first argument |
| T2 | type of second argument |
| x1 | first argument |
| x2 | second argument |
true if x1 > x2 Definition at line 18 of file logical_gt.hpp.
|
inline |
Return 1 if the first argument is greater than or equal to the second.
Equivalent to x1 >= x2.
| T1 | type of first argument |
| T2 | type of second argument |
| x1 | first argument |
| x2 | second argument |
true if x1 >= x2 Definition at line 18 of file logical_gte.hpp.
|
inline |
Return 1 if the first argument is strictly less than the second.
Equivalent to x1 < x2.
| T1 | type of first argument |
| T2 | type of second argument |
| x1 | first argument |
| x2 | second argument |
true if x1 < x2 Definition at line 18 of file logical_lt.hpp.
|
inline |
Return 1 if the first argument is less than or equal to the second.
Equivalent to x1 <= x2.
| T1 | type of first argument |
| T2 | type of second argument |
| x1 | first argument |
| x2 | second argument |
true iff x1 <= x2 Definition at line 18 of file logical_lte.hpp.
|
inline |
The logical negation function which returns one if the input is equal to zero and zero otherwise.
| T | type of value |
| x | value |
Definition at line 17 of file logical_negation.hpp.
|
inline |
Return 1 if the first argument is unequal to the second.
Equivalent to x1 != x2.
| T1 | type of first argument |
| T2 | type of second argument |
| x1 | first argument |
| x2 | second argument |
true iff x1 != x2 Definition at line 19 of file logical_neq.hpp.
|
inline |
The logical or function which returns 1 if either argument is unequal to zero and 0 otherwise.
Equivalent to x1 != 0 || x2 != 0.
\[ \mbox{operator||}(x, y) = \begin{cases} 0 & \mbox{if } x, y=0 \\ 1 & \mbox{if } x \neq 0 \textrm{ or } y\neq0\\[6pt] 1 & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| T1 | type of first argument |
| T2 | type of second argument |
| x1 | first argument |
| x2 | second argument |
true if either x1 or x2 is not equal to 0. Definition at line 29 of file logical_or.hpp.
| return_type_t<T_y, T_loc, T_scale> stan::math::logistic_cdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 24 of file logistic_cdf.hpp.
| return_type_t<T_y, T_loc, T_scale> stan::math::logistic_lccdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 24 of file logistic_lccdf.hpp.
| return_type_t<T_y, T_loc, T_scale> stan::math::logistic_lcdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 24 of file logistic_lcdf.hpp.
| return_type_t<T_y, T_loc, T_scale> stan::math::logistic_lpdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 27 of file logistic_lpdf.hpp.
|
inline |
Definition at line 95 of file logistic_lpdf.hpp.
|
inline |
|
inline |
Return the log odds of the argument.
The logit function is defined as for \(x \in [0, 1]\) by returning the log odds of \(x\) treated as a probability,
\(\mbox{logit}(x) = \log \left( \frac{x}{1 - x} \right)\).
The inverse to this function is inv_logit.
\[ \mbox{logit}(x) = \begin{cases} \textrm{NaN}& \mbox{if } x < 0 \textrm{ or } x > 1\\ \ln\frac{x}{1-x} & \mbox{if } 0\leq x \leq 1 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{logit}(x)}{\partial x} = \begin{cases} \textrm{NaN}& \mbox{if } x < 0 \textrm{ or } x > 1\\ \frac{1}{x-x^2}& \mbox{if } 0\leq x\leq 1 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| u | argument |
|
inline |
|
inline |
Return the elementwise application of logit() to specified argument container.
The return type promotes the underlying scalar argument type to double if it is an integer, and otherwise is the argument type.
| Container | type of container |
| x | container |
|
inline |
Version of logit() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these.
| Container | Type of x |
| x | Container |
Note: The return must be evaluated otherwise the Ref object falls out of scope
|
inline |
Definition at line 145 of file loglogistic_lpdf.hpp.
| return_type_t<T_y, T_loc, T_scale> stan::math::lognormal_cdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 28 of file lognormal_cdf.hpp.
| return_type_t<T_y, T_loc, T_scale> stan::math::lognormal_lccdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 28 of file lognormal_lccdf.hpp.
| return_type_t<T_y, T_loc, T_scale> stan::math::lognormal_lcdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 28 of file lognormal_lcdf.hpp.
| return_type_t<T_y, T_loc, T_scale> stan::math::lognormal_lpdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 28 of file lognormal_lpdf.hpp.
|
inline |
Definition at line 104 of file lognormal_lpdf.hpp.
|
inline |
Return the lower and upper-bounded matrix derived by transforming the specified free matrix given the specified lower and upper bounds.
The transform is the transformed and scaled inverse logit,
\(f(x) = L + (U - L) \mbox{logit}^{-1}(x)\)
| T | matrix expression type |
| L | lower bound expression type |
| U | upper bound expression type |
| [in] | x | Free matrix to transform. |
| [in] | lb | Lower bound |
| [in] | ub | Upper bound |
| std::domain_error | if ub <= lb |
Definition at line 35 of file lub_constrain.hpp.
|
inline |
Return the bounded value for the specified unconstrained input and specified bounds.
The transform applied is
\(f(x) = \exp(x) + L\)
where \(L\) is the constant lower bound.
| T_x | type of the unconstrained input |
| T_lb | type of lower bound |
| T_ub | type of upper bound |
| [in] | x | unconstrained input |
| [in] | lb | lower bound |
| [in] | ub | upper bound |
Definition at line 42 of file lub_constrain.hpp.
|
inline |
Return the lower and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds.
The transform is the transformed and scaled inverse logit,
\(f(x) = L + (U - L) \mbox{logit}^{-1}(x)\)
| T | Scalar. |
| L | Scalar. |
| U | Scalar. |
| [in] | x | Free scalar to transform. |
| [in] | lb | Lower bound. |
| [in] | ub | Upper bound. |
| std::domain_error | if ub <= lb |
Definition at line 46 of file lub_constrain.hpp.
|
inline |
Return the lower and upper-bounded matrix derived by transforming the specified free matrix given the specified lower and upper bounds.
Specialization for Eigen matrix and matrix bounds plus lp.
Return the lower- and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds and increment the specified log density with the log absolute Jacobian determinant.
Overload for Eigen matrix and matrix bounds plus lp.
The transform is the transformed and scaled inverse logit,
\(f(x) = L + (U - L) \mbox{logit}^{-1}(x)\)
| T | matrix expression type |
| L | lower bound expression type |
| U | upper bound expression type |
| [in] | x | Free matrix to transform. |
| [in] | lb | Lower bound |
| [in] | ub | Upper bound |
| [in,out] | lp | Log probability scalar reference |
| std::domain_error | if ub <= lb |
The transform is as defined in lub_constrain(T, double, double). The log absolute Jacobian determinant is given by
\(\log \left| \frac{d}{dx} \left( L + (U-L) \mbox{logit}^{-1}(x) \right) \right|\)
\( {} = \log | (U-L) \, (\mbox{logit}^{-1}(x)) \, (1 - \mbox{logit}^{-1}(x)) |\)
\( {} = \log (U - L) + \log (\mbox{logit}^{-1}(x)) + \log (1 - \mbox{logit}^{-1}(x))\)
| T | Scalar. |
| L | Scalar. |
| U | Scalar. |
| [in] | x | Free scalar to transform. |
| [in] | lb | Lower bound. |
| [in] | ub | Upper bound. |
| [in,out] | lp | Log probability scalar reference. |
| std::domain_error | if ub <= lb |
Definition at line 74 of file lub_constrain.hpp.
|
inline |
Return the lower- and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds and increment the specified log density with the log absolute Jacobian determinant.
The transform is as defined in lub_constrain(T, double, double). The log absolute Jacobian determinant is given by
\(\log \left| \frac{d}{dx} \left( L + (U-L) \mbox{logit}^{-1}(x) \right) \right|\)
\( {} = \log | (U-L) \, (\mbox{logit}^{-1}(x)) \, (1 - \mbox{logit}^{-1}(x)) |\)
\( {} = \log (U - L) + \log (\mbox{logit}^{-1}(x)) + \log (1 - \mbox{logit}^{-1}(x))\)
| T | Scalar. |
| L | Scalar. |
| U | Scalar. |
| [in] | x | Free scalar to transform. |
| [in] | lb | Lower bound. |
| [in] | ub | Upper bound. |
| [in,out] | lp | Log probability scalar reference. |
| std::domain_error | if ub <= lb |
Definition at line 97 of file lub_constrain.hpp.
|
inline |
Return the bounded value for the specified unconstrained input and specified bounds.
The transform applied is
\(f(x) = \exp(x) + L\)
where \(L\) is the constant lower bound.
| T_x | type of the unconstrained input |
| T_lb | type of lower bound |
| T_ub | type of upper bound |
| [in] | x | unconstrained input |
| [in] | lb | lower bound |
| [in] | ub | upper bound |
| [in,out] | lp | reference to log probability to increment |
Definition at line 98 of file lub_constrain.hpp.
|
inline |
Overload for Eigen matrix and scalar bounds.
Specialization for Eigen matrix with scalar lower bound and matrix upper bound.
Specialization for Eigen matrix with matrix lower bound and scalar upper bound.
Specialization for Eigen matrix and scalar bounds.
Overload for Eigen matrix with scalar lower bound and matrix upper bound.
Overload for Eigen matrix with matrix lower bound and scalar upper bound.
Definition at line 120 of file lub_constrain.hpp.
|
inline |
Overload for Eigen matrix and scalar bounds plus lp.
Specialization for Eigen matrix and scalar bounds plus lp.
Overload for Eigen matrix with scalar lower bound and matrix upper bound plus lp.
Overload for Eigen matrix with matrix lower bound and scalar upper bound plus lp.
Definition at line 131 of file lub_constrain.hpp.
|
inline |
Overload for Eigen matrix and matrix bounds.
Specialization for Eigen matrix and matrix bounds.
Return the lower and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds.
The transform is the transformed and scaled inverse logit,
\(f(x) = L + (U - L) \mbox{logit}^{-1}(x)\)
| T | Scalar. |
| L | Scalar. |
| U | Scalar. |
| [in] | x | Free scalar to transform. |
| [in] | lb | Lower bound. |
| [in] | ub | Upper bound. |
| std::domain_error | if ub <= lb |
Definition at line 203 of file lub_constrain.hpp.
|
inline |
Overload for array of x and non-array lb and ub.
Definition at line 247 of file lub_constrain.hpp.
|
inline |
Overload for array of x and non-array lb and ub with lp.
Definition at line 261 of file lub_constrain.hpp.
|
inline |
Overload for array of x and ub and non-array lb.
Definition at line 276 of file lub_constrain.hpp.
|
inline |
Overload for array of x and ub and non-array lb with lp.
Definition at line 292 of file lub_constrain.hpp.
|
inline |
Specialization for Eigen matrix with matrix lower bound and scalar upper bound plus lp.
Specialization for Eigen matrix with scalar lower bound and matrix upper bound plus lp.
Definition at line 305 of file lub_constrain.hpp.
|
inline |
Overload for array of x and lb and non-array ub.
Definition at line 309 of file lub_constrain.hpp.
|
inline |
Overload for array of x and lb and non-array ub with lp.
Definition at line 325 of file lub_constrain.hpp.
|
inline |
Overload for array of x, lb, and ub with lp.
Definition at line 340 of file lub_constrain.hpp.
|
inline |
Overload for array of x, lb, and ub.
Definition at line 356 of file lub_constrain.hpp.
|
inline |
Return the lower and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds.
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| L | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| U | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| [in] | x | Free scalar to transform |
| [in] | lb | Lower bound |
| [in] | ub | Upper bound |
| [in,out] | lp | log density accumulator |
| std::domain_error | if ub <= lb |
Definition at line 394 of file lub_constrain.hpp.
|
inline |
lub_free Return the unconstrained variable that transforms to the y given the specified bounds.
Overload for matrix constrained variable, matrix upper bound, scalar lower bound.
Overload for matrix constrained variable, matrix lower bound, scalar upper bound.
The transform in lub_constrain, is reversed by a transformed and scaled logit,
\(f^{-1}(y) = \mbox{logit}(\frac{y - L}{U - L})\)
where \(U\) and \(L\) are the lower and upper bounds.
| T | type of bounded object |
| L | type of lower bound |
| U | type of upper bound |
| y | constrained value |
| lb | lower bound |
| ub | upper bound |
| std::invalid_argument | if the lower bound is greater than the upper bound, y is less than the lower bound, or y is greater than the upper bound Overload for all scalar arguments |
Definition at line 46 of file lub_free.hpp.
|
inline |
Overload for matrix constrained variable, matrix upper bound, matrix lower bound.
Definition at line 110 of file lub_free.hpp.
|
inline |
Overload for std::vector constrained variable.
Definition at line 131 of file lub_free.hpp.
|
inline |
Overload for std::vector constrained variable and std::vector upper bound.
Definition at line 144 of file lub_free.hpp.
|
inline |
Overload for std::vector constrained variable and std::vector lower bound.
Definition at line 159 of file lub_free.hpp.
|
inline |
Overload for std::vector constrained variable and std::vector constraints.
Definition at line 173 of file lub_free.hpp.
|
inlinestatic |
Returns the difference between 1.0 and the next value representable.
Definition at line 221 of file constants.hpp.
| var_value<plain_type_t<T> > stan::math::make_callback_var | ( | T && | value, |
| F && | functor | ||
| ) |
Creates a new var initialized with a callback_vari with a given value and reverse-pass callback functor.
The callback functor will be passed a reference to the constructed vari.
All captured values must be trivially destructible or they will leak memory. to_arena() function can be used to ensure that.
| T | type of value |
| F | type of callable |
| value | value of the vari |
| functor | functor or other callable to call in the reverse pass |
Definition at line 61 of file callback_vari.hpp.
| internal::callback_vari<plain_type_t<T>, F>* stan::math::make_callback_vari | ( | T && | value, |
| F && | functor | ||
| ) |
Creates a new vari with given value and a callback that implements the reverse pass (chain).
The callback needs to accept a referenct to the vari. If it needs any other data it should be implemented as a lambda capturing the variables it needs.
All captured values must be trivially destructible or they will leak memory! to_arena() function can be used to ensure that.
| T | type of value |
| F | type of callable |
| value | value of the vari |
| functor | functor or other callable to call in the reverse pass |
Definition at line 41 of file callback_vari.hpp.
| auto stan::math::make_chainable_ptr | ( | T && | obj | ) |
Store the given object in a chainable_object so it is destructed only when the chainable stack memory is recovered and return a pointer to the underlying object.
| T | type of object to hold |
| obj | object to hold |
chainable_object Definition at line 60 of file chainable_object.hpp.
| auto stan::math::make_holder | ( | const F & | func, |
| Args &&... | args | ||
| ) |
Constructs an expression from given arguments using given functor.
Calls given function with given arguments.
This is similar to calling the functor with given arguments. Except that any rvalue argument will be moved to heap first. The arguments moved to heap are deleted once the expression is destructed.
| F | type of the functor |
| Args | types of the arguments |
| func | the functor |
| args | arguments for the functor |
holder referencing expression constructed by given functorNo holder is necessary if the function is not returning Eigen expression.
| F | type of the functor |
| Args | types of the arguments |
| func | the functor |
| args | arguments for the functor |
holder referencing expression constructed by given functor Definition at line 352 of file holder.hpp.
|
inline |
Make an LDLT_factor with matrix type plain_type_t<T>
| T | Type of matrix to take the LDLT of |
| A | Matrix to take the LDLT of |
Definition at line 62 of file LDLT_factor.hpp.
| Eigen::Array<T, Eigen::Dynamic, 1> stan::math::make_nu | ( | const T & | eta, |
| size_t | K | ||
| ) |
Return the degrees of freedom for the t distribution that corresponds to the shape parameter in the LKJ distribution.
| T | scalar type |
| eta | LKJ distribution parameter in (0, inf) |
| K | number of variables in correlation matrix |
Definition at line 19 of file make_nu.hpp.
| auto stan::math::make_unsafe_chainable_ptr | ( | T && | obj | ) |
Store the given object in a chainable_object so it is destructed only when the chainable stack memory is recovered and return a pointer to the underlying object This function differs from make_chainable_object in that this class does not evaluate expressions.
| T | type of object to hold |
| obj | object to hold |
chainable_object Definition at line 115 of file chainable_object.hpp.
| Eigen::Matrix<return_type_t<T_shared_param, T_job_param>, Eigen::Dynamic, 1> stan::math::map_rect | ( | const T_shared_param & | shared_params, |
| const std::vector< Eigen::Matrix< T_job_param, Eigen::Dynamic, 1 >> & | job_params, | ||
| const std::vector< std::vector< double >> & | x_r, | ||
| const std::vector< std::vector< int >> & | x_i, | ||
| std::ostream * | msgs = nullptr |
||
| ) |
Map N function evaluations to parameters and data which are in rectangular format.
Each function evaluation may return a column vector of different sizes and the output is the concatenated vector from all evaluations.
In addition to job specific parameters, real and int data, a shared parameter vector is repeated in all evaluations. All input parameters are stored as vectors whereas data is stored as arrays.
For N jobs the output of this function is
[ f(shared_params, job_params[1], x_r[1], x_i[1]), f(shared_params, job_params[2], x_r[2], x_i[2]), ... ]'.
The function is implemented with serial execution and with parallelism using threading or MPI (TODO). The threading version is used if the compiler flag STAN_THREADS is set during compilation while the MPI version is only available if STAN_MPI is defined. The MPI parallelism takes precedence over serial or threading execution of the function.
For the threaded parallelism the N jobs are chunked into T blocks which are executed asynchronously using the async C++11 facility. This ensure that at most T threads are used, but the actual number of threads is controlled by the implementation of async provided by the compiler. Note that nested calls of map_rect will lead to a multiplicative increase in the number of job chunks generated. The number of threads T is controlled at runtime via the STAN_NUM_threads environment variable, see the get_num_threads function for details.
For the MPI version to work this function has these special non-standard conventions:
The functor F is expected to have the usual operator() function with signature
template <typename T1, typename T2> Eigen::Matrix<return_type_t<T1, T2>, Eigen::Dynamic, 1> operator()(const Eigen::Matrix<T1, Eigen::Dynamic, 1>& eta, const Eigen::Matrix<T2, Eigen::Dynamic, 1>& theta, const std::vector<double>& x_r, const std::vector<int>& x_i, std::ostream* msgs = 0) const { ... }
If an expression is passed as shared_params, the functor needs to accept expression.
WARNING: For the MPI case, the data arguments are NOT checked if they are unchanged between repeated evaluations for a given call_id/functor F pair. This is silently assumed to be immutable between evaluations.
| T_shared_param | Type of shared parameters. |
| T_job_param | Type of job specific parameters. |
| shared_params | shared parameter vector passed as first argument to functor for all jobs |
| job_params | Array of job specific parameter vectors. All job specific parameters must have matching sizes. |
| x_r | Array of real arrays for each job. The first dimension must match the number of jobs (which is determined by the first dimension of job_params) and each entry must have the same size. |
| x_i | Array of int data with the same conventions as x_r. |
| msgs | Output stream for messages. |
| call_id | Label for functor/data combination. See above for details. |
| F | Functor which is applied to all job specific parameters with conventions described. |
Definition at line 127 of file map_rect.hpp.
|
inline |
Return the matrix exponential of the input matrix.
| T | type of the matrix |
| [in] | A_in | Matrix to exponentiate. |
| <code>std::invalid_argument</code> | if the input matrix is not square. |
Definition at line 25 of file matrix_exp.hpp.
| Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, Eigen::Dynamic> stan::math::matrix_exp_2x2 | ( | const EigMat & | A | ) |
Return the matrix exponential of a 2x2 matrix.
Reference for algorithm: http://mathworld.wolfram.com/MatrixExponential.html Note: algorithm only works if delta > 0;
| EigMat | type of the matrix |
| [in] | A | 2x2 matrix to exponentiate. |
Definition at line 26 of file matrix_exp_2x2.hpp.
|
inline |
Return product of exp(A) and B, where A is a NxN double matrix, B is a NxCb double matrix, and t is a double.
| Cb | number of columns in matrix B, can be Eigen::Dynamic |
| [in] | A | Matrix |
| [in] | B | Matrix |
Definition at line 24 of file matrix_exp_multiply.hpp.
|
inline |
Wrapper of matrix_exp_action function for a more literal name.
| Ta | type of the matrix A |
| Tb | type of the matrix B |
| [in] | A | Matrix |
| [in] | B | Matrix |
Definition at line 27 of file matrix_exp_multiply.hpp.
| Eigen::Matrix<value_type_t<EigMat>, EigMat::RowsAtCompileTime, EigMat::ColsAtCompileTime> stan::math::matrix_exp_pade | ( | const EigMat & | arg | ) |
Computes the matrix exponential, using a Pade approximation, coupled with scaling and squaring.
| MatrixType | type of the matrix |
| [in] | arg | matrix to exponentiate. |
Definition at line 23 of file matrix_exp_pade.hpp.
| return_type_t<T_y, T_Mu, T_Sigma, T_D> stan::math::matrix_normal_prec_lpdf | ( | const T_y & | y, |
| const T_Mu & | Mu, | ||
| const T_Sigma & | Sigma, | ||
| const T_D & | D | ||
| ) |
Definition at line 84 of file matrix_normal_prec_lpdf.hpp.
|
inline |
Returns the nth power of the specific matrix.
M^n = M * M * ... * M.
| T | type of the matrix |
| [in] | M | a square matrix |
| [in] | n | exponent |
| std::domain_error | if the matrix contains NaNs or infinities. |
| std::invalid_argument | if the exponent is negative or the matrix is not square. |
Definition at line 26 of file matrix_power.hpp.
|
inline |
Returns the nth power of the specific matrix.
M^n = M * M * ... * M.
| T | type of the matrix |
| [in] | M | a square matrix |
| [in] | n | exponent |
| std::domain_error | if the matrix contains NaNs or infinities. |
| std::invalid_argument | if the exponent is negative or the matrix is not square. |
Definition at line 27 of file matrix_power.hpp.
|
inline |
Returns the nth power of the specific matrix.
M^n = M * M * ... * M.
| R | number of rows, can be Eigen::Dynamic |
| C | number of columns, can be Eigen::Dynamic |
| [in] | M | a square matrix |
| [in] | n | exponent |
| std::domain_error | if the matrix contains NaNs or infinities. |
| std::invalid_argument | if the exponent is negative or the matrix is not square. |
Definition at line 29 of file matrix_power.hpp.
|
inline |
Returns the nth power of the specific matrix.
M^n = M * M * ... * M.
| T | type of the matrix |
| [in] | M | a square matrix |
| [in] | n | exponent |
| std::domain_error | if the matrix contains NaNs or infinities. |
| std::invalid_argument | if the exponent is negative or the matrix is not square. |
Definition at line 29 of file matrix_power.hpp.
|
inline |
Multiplies a matrix and a vector on an OpenCL device.
| T_matrix | type of the matrix or matrix expression |
| T_vector | type of the vector or vector expression |
| matrix | the matrix |
| vector | the vector |
| invalid_argument | vector has more than column or matrix has different number of rows than vector columns. |
Definition at line 27 of file matrix_vector_multiply.hpp.
|
inline |
Returns the maximum coefficient in the specified matrix, vector, row vector or std vector.
| T | type of the container |
| m | specified matrix, vector, row vector or std vector |
| <code>std::invalid_argument</code> | if the vector is size zero and the scalar type in the container is integer |
|
inline |
Calculate the size of the largest input.
| T1 | type of the first input |
| Ts | types of the other inputs |
| x1 | first input |
| xs | other inputs |
Definition at line 19 of file max_size.hpp.
|
inline |
Calculate the size of the largest multivariate input.
A multivariate container is either an Eigen matrix, whose mvt size is 1, or an std::vector of Eigen matrices, whose mvt size is the size of the std::vector. It is an error to supply any other type of input.
| T1 | type of the first input |
| Ts | types of the other inputs |
| x1 | first input |
| xs | other inputs |
| <tt>invalid_argument</tt> | if provided with an input that is not an Eigen matrix or std::vector of Eigen matrices |
Definition at line 24 of file max_size_mvt.hpp.
|
inline |
Definition at line 21 of file mdivide_left.hpp.
|
inline |
Returns the solution of the system Ax=b.
| T1 | type of the first matrix |
| T2 | type of the right-hand side matrix or vector |
| A | Matrix. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 27 of file mdivide_left.hpp.
|
inline |
Return the solution X of AX = B.
A must be a square matrix, but B can be a matrix or a vector
| T1 | type of first matrix |
| T2 | type of second matrix |
| [in] | A | square matrix |
| [in] | B | right hand side |
Definition at line 30 of file mdivide_left.hpp.
|
inline |
Definition at line 62 of file mdivide_left.hpp.
|
inline |
Returns the solution of the system Ax=b given an LDLT_factor of A.
| T | type of B |
| A | LDLT_factor |
| B | Right hand side matrix or vector. |
| std::domain_error | if rows of B don't match the size of A. |
Definition at line 27 of file mdivide_left_ldlt.hpp.
|
inline |
Returns the solution of the system Ax=b given an LDLT_factor of A.
| T | type of matrix for the LDLT_factor |
| EigMat | type of the right-hand side matrix or vector |
| A | LDLT_factor |
| b | right-hand side matrix or vector |
| std::domain_error | if rows of b don't match the size of A. |
Definition at line 28 of file mdivide_left_ldlt.hpp.
|
inline |
Returns the solution of the system Ax=b given an LDLT_factor of A.
| T | type of matrix in the LDLT_factor |
| EigMat | type of the right hand side |
| A | LDLT_factor |
| b | Right hand side matrix or vector. |
| std::domain_error | if rows of b don't match the size of A. |
Definition at line 30 of file mdivide_left_ldlt.hpp.
|
inline |
Returns the solution of the system Ax=b where A is symmetric positive definite.
| EigMat1 | type of the first matrix |
| EigMat2 | type of the right-hand side matrix or vector |
| A | Matrix. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 30 of file mdivide_left_spd.hpp.
|
inline |
Definition at line 152 of file mdivide_left_spd.hpp.
|
inline |
Definition at line 183 of file mdivide_left_spd.hpp.
|
inline |
Returns the solution of the system Ax=B where A is symmetric positive definite.
This overload handles arguments where one of T1 or T2 are var_value<T> where T is an Eigen type. The other type can also be a var_value or it can be a matrix type that inherits from EigenBase
| T1 | type of the first matrix |
| T2 | type of the right-hand side matrix or vector |
| A | Matrix. |
| B | Right hand side matrix or vector. |
| std::domain_error | if A is not square or B does not have as many rows as A has columns. |
Definition at line 261 of file mdivide_left_spd.hpp.
|
inline |
Returns the solution of the system Ax=b when A is triangular.
| TriView | Specifies whether A is upper (Eigen::Upper) or lower triangular (Eigen::Lower). |
| T1 | type of the triangular matrix |
| T2 | type of the right-hand side matrix or vector |
| A | Triangular matrix. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 31 of file mdivide_left_tri.hpp.
|
inline |
Returns the solution of the system Ax=b when A is triangular and b=I.
| T | type of the matrix |
| A | Triangular matrix. |
| std::domain_error | if A is not square |
Definition at line 55 of file mdivide_left_tri.hpp.
|
inline |
Definition at line 248 of file mdivide_left_tri.hpp.
|
inline |
Definition at line 274 of file mdivide_left_tri.hpp.
|
inline |
Returns the solution of the system Ax=B when A is triangular.
This overload handles arguments where one of T1 or T2 are var_value<T> where T is an Eigen type. The other type can also be a var_value or it can be a matrix type that inherits from EigenBase
| TriView | Specifies whether A is upper (Eigen::Upper) or lower triangular (Eigen::Lower). |
| T1 | type of the triangular matrix |
| T2 | type of the right-hand side matrix or vector |
| A | Triangular matrix. |
| B | Right hand side matrix or vector. |
| std::domain_error | if A is not square or B does not have as many rows as A has columns. |
Definition at line 345 of file mdivide_left_tri.hpp.
|
inline |
Definition at line 20 of file mdivide_left_tri_low.hpp.
|
inline |
Returns the solution of the system Ax=b when A is lower triangular.
| T1 | type of elements in A |
| T2 | type of elements in b |
| A | Triangular matrix. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 26 of file mdivide_left_tri_low.hpp.
|
inline |
Returns the solution of the system Ax=b when A is lower triangular.
| T1 | type of elements in A |
| T2 | type of elements in b |
| A | Triangular matrix. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 30 of file mdivide_left_tri_low.hpp.
|
inline |
Return the result of left dividing the second argument by the first argument.
Calling mdivide_left_tri_low(A, b) with divisor A and dividend b is more arithmetically stable than calling inv(A) * b.
| T1 | type of the divisor matrix |
| T2 | type of the dividend matrix |
| A | divisor, an invertible square matrix |
| b | dividend, a matrix or vector with the same number of rows as the divisor has columns |
| std::invalid_argument | if the divisor is not square or the dividend does not have the same number of rows as the divisor has columns. |
Definition at line 33 of file mdivide_left_tri_low.hpp.
|
inline |
Returns the solution of the system Ax=b when A is triangular and b=I.
| T | type of elements in A |
| A | Triangular matrix. |
| std::domain_error | if A is not square |
Definition at line 44 of file mdivide_left_tri_low.hpp.
|
inline |
Definition at line 45 of file mdivide_left_tri_low.hpp.
|
inline |
Definition at line 57 of file mdivide_left_tri_low.hpp.
|
inline |
Returns the solution of the system Ax=b when A is triangular and b=I.
| T | type of elements in A |
| A | Triangular matrix. |
| std::domain_error | if A is not square |
Definition at line 65 of file mdivide_left_tri_low.hpp.
|
inline |
Definition at line 87 of file mdivide_left_tri_low.hpp.
|
inline |
Definition at line 21 of file mdivide_right.hpp.
|
inline |
Returns the solution of the system xA=b.
| EigMat1 | type of the right-hand side matrix or vector |
| EigMat2 | type of the second matrix |
| A | Matrix. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 28 of file mdivide_right.hpp.
|
inline |
Definition at line 97 of file mdivide_right.hpp.
|
inline |
Returns the solution of the system xA=b given an LDLT_factor of A.
| EigMat | type of the right hand side |
| T | type of matrix in the LDLT_factor |
| A | LDLT_factor |
| b | Right hand side matrix or vector. |
| std::domain_error | if rows of b don't match the size of A. |
Definition at line 27 of file mdivide_right_ldlt.hpp.
|
inline |
Returns the solution of the system xA=b given an LDLT_factor of A.
Overload for arithmetic types
| EigMat | type of the right hand side |
| T | type of matrix in the LDLT_factor |
| A | LDLT_factor |
| b | Right hand side matrix or vector. |
| std::domain_error | if rows of b don't match the size of A. |
Definition at line 51 of file mdivide_right_ldlt.hpp.
|
inline |
Returns the solution of the system xA=b where A is symmetric positive definite.
| EigMat1 | type of the right-hand side matrix or vector |
| EigMat2 | type of the second matrix |
| b | right-hand side matrix or vector |
| A | matrix |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 30 of file mdivide_right_spd.hpp.
|
inline |
Returns the solution of the system xA=b when A is triangular.
| TriView | Specifies whether A is upper (Eigen::Upper) or lower triangular (Eigen::Lower). |
| EigMat1 | type of the right-hand side matrix or vector |
| EigMat2 | type of the triangular matrix |
| A | Triangular matrix. Specify upper or lower with TriView being Eigen::Upper or Eigen::Lower. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 31 of file mdivide_right_tri.hpp.
|
inline |
Definition at line 19 of file mdivide_right_tri_low.hpp.
|
inline |
Returns the solution of the system Ax=b where A is a lower triangular matrix.
| A | Matrix. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 25 of file mdivide_right_tri_low.hpp.
|
inline |
Returns the solution of the system x tri(A) = b when tri(A) is a lower triangular view of the matrix A.
| EigMat1 | type of the right-hand side matrix or vector |
| EigMat2 | type of the second matrix |
| b | right-hand side matrix or vector |
| A | matrix |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 29 of file mdivide_right_tri_low.hpp.
|
inline |
Returns the solution of the system Ax=b when A is lower triangular.
| T1 | type of elements in A |
| T2 | type of elements in b |
| A | Triangular matrix. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 30 of file mdivide_right_tri_low.hpp.
|
inline |
Definition at line 98 of file mdivide_right_tri_low.hpp.
| scalar_type_t<T> stan::math::mean | ( | const T & | m | ) |
|
inline |
Returns the sample mean (i.e., average) of the coefficients in the specified std vector, vector, row vector, or matrix.
| T | type of the matrix |
| m | Specified std vector, vector, row vector, or matrix. |
|
inline |
Returns the minimum coefficient in the specified matrix, vector, row vector or std vector.
| T | type of elements in the container |
| m | specified matrix, vector, row vector or std vector |
| <code>std::invalid_argument</code> | if the vector is size zero and the scalar type in the container is integer |
|
inline |
|
inline |
Definition at line 12 of file modified_bessel_first_kind.hpp.
Definition at line 26 of file modified_bessel_first_kind.hpp.
|
inline |
\[ \mbox{modified\_bessel\_first\_kind}(v, z) = \begin{cases} I_v(z) & \mbox{if } -\infty\leq z \leq \infty \\[6pt] \textrm{error} & \mbox{if } z = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{modified\_bessel\_first\_kind}(v, z)}{\partial z} = \begin{cases} \frac{\partial\, I_v(z)}{\partial z} & \mbox{if } -\infty\leq z\leq \infty \\[6pt] \textrm{error} & \mbox{if } z = \textrm{NaN} \end{cases} \]
\[ {I_v}(z) = \left(\frac{1}{2}z\right)^v\sum_{k=0}^\infty \frac{\left(\frac{1}{4}z^2\right)^k}{k!\Gamma(v+k+1)} \]
\[ \frac{\partial \, I_v(z)}{\partial z} = I_{v-1}(z)-\frac{v}{z}I_v(z) \]
Definition at line 38 of file modified_bessel_first_kind.hpp.
|
inline |
This function exists because when z is of type integer, cyl_bessel_i(v, z) returns an integer.
This results in overflow when the function value is large.
Definition at line 49 of file modified_bessel_first_kind.hpp.
|
inline |
Enables the vectorised application of the modified_bessel_first_kind function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 66 of file modified_bessel_first_kind.hpp.
|
inline |
Definition at line 12 of file modified_bessel_second_kind.hpp.
Definition at line 26 of file modified_bessel_second_kind.hpp.
|
inline |
\[ \mbox{modified\_bessel\_second\_kind}(v, z) = \begin{cases} \textrm{error} & \mbox{if } z \leq 0 \\ K_v(z) & \mbox{if } z > 0 \\[6pt] \textrm{NaN} & \mbox{if } z = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{modified\_bessel\_second\_kind}(v, z)}{\partial z} = \begin{cases} \textrm{error} & \mbox{if } z \leq 0 \\ \frac{\partial\, K_v(z)}{\partial z} & \mbox{if } z > 0 \\[6pt] \textrm{NaN} & \mbox{if } z = \textrm{NaN} \end{cases} \]
\[ {K_v}(z) = \frac{\pi}{2}\cdot\frac{I_{-v}(z) - I_{v}(z)}{\sin(v\pi)} \]
\[ \frac{\partial \, K_v(z)}{\partial z} = -\frac{v}{z}K_v(z)-K_{v-1}(z) \]
Definition at line 43 of file modified_bessel_second_kind.hpp.
|
inline |
Enables the vectorised application of the modified_bessel_second_kind function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 58 of file modified_bessel_second_kind.hpp.
|
inline |
Definition at line 12 of file modulus.hpp.
| std::unique_lock< std::mutex > stan::math::mpi_broadcast_command | ( | ) |
Broadcasts default constructible commands to the cluster.
| T | default constructible command class derived from mpi_command |
Definition at line 238 of file mpi_cluster.hpp.
|
inline |
Broadcasts a command instance to the listening cluster.
This function must be called on the root whenever the cluster is in listening mode and errs otherwise.
| command | shared pointer to an instance of a command class derived from mpi_command |
Definition at line 209 of file mpi_cluster.hpp.
|
inline |
Maps jobs of given chunk size to workers and returning a vector of counts.
The returned vector is indexed by the rank of each worker and has size equal to the # of workers. Each count per worker is the product of the number of assigned jobs times the chunk size. The jobs are deterministically assigned to workers. This is used for static scheduling of jobs internally.
So with num_workers workers, then the counts for worker with given rank is
chunks[rank] = floor(num_jobs/num_workers) * chunk_size
The remainder jobs num_jobs % num_workers are assigned to rank >=1 workers such that the root (rank = 0) has a little less assigned chunks unless num_jobs < num_workers in which case the first num_jobs nodes receive a job (including the root).
| num_jobs | Total number of jobs to dispatch |
| chunk_size | Chunk size per job |
Definition at line 84 of file mpi_cluster.hpp.
|
inline |
Definition at line 87 of file multi_gp_cholesky_lpdf.hpp.
|
inline |
Definition at line 85 of file multi_gp_lpdf.hpp.
|
inline |
Definition at line 299 of file multi_normal_cholesky_lpdf.hpp.
| return_type_t<T_y, T_loc, T_covar> stan::math::multi_normal_lpdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_covar & | Sigma | ||
| ) |
Definition at line 19 of file multi_normal_lpdf.hpp.
|
inline |
Definition at line 106 of file multi_normal_lpdf.hpp.
| return_type_t<T_y, T_loc, T_covar> stan::math::multi_normal_prec_lpdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_covar & | Sigma | ||
| ) |
Definition at line 20 of file multi_normal_prec_lpdf.hpp.
|
inline |
Definition at line 106 of file multi_normal_prec_lpdf.hpp.
|
inline |
Definition at line 142 of file multi_student_t_lpdf.hpp.
| return_type_t<T_beta> stan::math::multinomial_logit_lpmf | ( | const std::vector< int > & | ns, |
| const T_beta & | beta | ||
| ) |
Definition at line 55 of file multinomial_logit_lpmf.hpp.
| return_type_t<T_prob> stan::math::multinomial_lpmf | ( | const std::vector< int > & | ns, |
| const T_prob & | theta | ||
| ) |
Definition at line 17 of file multinomial_lpmf.hpp.
| return_type_t<T_prob> stan::math::multinomial_lpmf | ( | const std::vector< int > & | ns, |
| const T_prob & | theta | ||
| ) |
Definition at line 45 of file multinomial_lpmf.hpp.
|
inline |
Definition at line 15 of file multinomial_rng.hpp.
|
inline |
Return the product of the specified matrices.
The number of columns in the first matrix must be the same as the number of rows in the second matrix.
| Mat1 | type of the first matrix or expression |
| Mat2 | type of the second matrix or expression |
| m1 | first matrix or expression |
| m2 | second matrix or expression |
| <code>std::invalid_argument</code> | if the number of columns of m1 does not match the number of rows of m2. |
Definition at line 18 of file multiply.hpp.
|
inline |
Return specified matrix multiplied by specified scalar.
| Mat | type of the matrix or expression |
| Scal | type of the scalar |
| m | matrix |
| c | scalar |
Definition at line 26 of file multiply.hpp.
|
inline |
Matrix multiplication of two reverse mode matrices and/or kernel generator expressions.
| T_a | type of first expression |
| T_b | type of second expression |
| A | first expression |
| B | second expression |
Definition at line 31 of file multiply.hpp.
|
inline |
Return specified scalar multiplied by specified matrix.
| Scal | type of the scalar |
| Mat | type of the matrix or expression |
| c | scalar |
| m | matrix |
Definition at line 43 of file multiply.hpp.
|
inline |
Return the product of the specified matrices.
The number of columns in the first matrix must be the same as the number of rows in the second matrix.
| Mat1 | type of the first matrix or expression |
| Mat2 | type of the second matrix or expression |
| m1 | first matrix or expression |
| m2 | second matrix or expression |
| <code>std::invalid_argument</code> | if the number of columns of m1 does not match the number of rows of m2. |
Definition at line 64 of file multiply.hpp.
|
inline |
Return matrix multiplied by a scalar.
| T1 | type of the scalar |
| T2 | type of the matrix or expression |
| A | scalar |
| B | matrix |
Definition at line 79 of file multiply.hpp.
|
inline |
Return the product of a row vector times a column vector as a scalar.
| T1 | type of row vector |
| T2 | type of column vector |
| [in] | A | row vector |
| [in] | B | column vector |
Definition at line 90 of file multiply.hpp.
|
inline |
Return matrix multiplied by a scalar.
Return the product of two matrices.
| T1 | type of the matrix or expression |
| T2 | type of the scalar |
| A | matrix |
| B | scalar |
This version does not handle row vector times column vector
| T1 | type of first matrix |
| T2 | type of second matrix |
| [in] | A | first matrix |
| [in] | B | second matrix |
Definition at line 104 of file multiply.hpp.
|
inline |
Return the scalar product of the specified row vector and specified column vector.
The return is the same as the dot product. The two vectors must be the same size.
| RowVec | type of the row vector |
| ColVec | type of the column vector |
| rv | row vector |
| v | column vector |
| <code>std::invalid_argument</code> | if rv and v are not the same size |
Definition at line 110 of file multiply.hpp.
|
inline |
Matrix multiplication of a scalar and a kernel generator expressions.
| T_a | type of scalar |
| T_b | type of the kernel generator expression |
| a | scalar |
| b | expression |
| T_a | type of the kernel generator expression |
| T_b | type of scalar |
| a | expression |
| b | scalar |
Definition at line 123 of file multiply.hpp.
|
inline |
Return product of scalars.
| Scalar1 | type of first scalar |
| Scalar2 | type of second scalar |
| m | scalar |
| c | scalar |
Definition at line 126 of file multiply.hpp.
|
inline |
Return specified matrix multiplied by specified scalar where at least one input has a scalar type of a var_value.
| T1 | type of the scalar |
| T2 | type of the matrix or expression |
| A | scalar |
| B | matrix |
| T1 | type of the matrix or expression |
| T2 | type of the scalar |
| A | matrix |
| B | scalar |
Definition at line 140 of file multiply.hpp.
|
inline |
Definition at line 13 of file multiply_log.hpp.
Definition at line 20 of file multiply_log.hpp.
Definition at line 26 of file multiply_log.hpp.
|
inline |
Returns the elementwise multiply_log() of the input.
| T_a | type of first expression |
| T_b | type of second expression |
| a | first expression |
| b | second expression |
multiply_log() of the input. Definition at line 28 of file multiply_log.hpp.
|
inline |
Calculate the value of the first argument times log of the second argument while behaving properly with 0 inputs.
\( a * \log b \).
\[ \mbox{multiply\_log}(x, y) = \begin{cases} 0 & \mbox{if } x=y=0\\ x\ln y & \mbox{if } x, y\neq 0 \\[6pt] \end{cases} \]
\[ \frac{\partial\, \mbox{multiply\_log}(x, y)}{\partial x} = \begin{cases} \ln y \\[6pt] \end{cases} \]
\[ \frac{\partial\, \mbox{multiply\_log}(x, y)}{\partial y} = \begin{cases} \frac{x}{y} \\[6pt] \end{cases} \]
| T_a | type of the first variable |
| T_b | type of the second variable |
| a | the first variable |
| b | the second variable |
Definition at line 49 of file multiply_log.hpp.
Return the value of a*log(b).
When both a and b are 0, the value returned is 0. The partial derivative with respect to a is log(b). The partial derivative with respect to b is a/b.
| a | First variable. |
| b | Second variable. |
Definition at line 56 of file multiply_log.hpp.
Return the value of a*log(b).
When both a and b are 0, the value returned is 0. The partial derivative with respect to a is log(b).
| a | First variable. |
| b | Second scalar. |
Definition at line 69 of file multiply_log.hpp.
|
inline |
Enables the vectorised application of the multiply_log function, when the first and/or second arguments are containers.
Return the product a * log(b).
Return the elementwise product a * log(b).
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Both T1 and T2 are matrices, and one of T1 or T2 must be a var_value
| T1 | Type of first argument |
| T2 | Type of second argument |
| a | First argument |
| b | Second argument |
a and log(b)| T1 | Type of matrix argument |
| T2 | Type of scalar argument |
| a | Matrix argument |
| b | Scalar argument |
a and log(b)| T1 | Type of scalar argument |
| T2 | Type of matrix argument |
| a | Scalar argument |
| b | Matrix argument |
a and log(b) Definition at line 70 of file multiply_log.hpp.
Return the value of a*log(b).
When both a and b are 0, the value returned is 0. The partial derivative with respect to b is a/b.
| a | First scalar. |
| b | Second variable. |
Definition at line 82 of file multiply_log.hpp.
|
inline |
Definition at line 15 of file multiply_lower_tri_self_transpose.hpp.
|
inline |
Definition at line 17 of file multiply_lower_tri_self_transpose.hpp.
|
inline |
Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose.
| L | Matrix to multiply. |
Definition at line 20 of file multiply_lower_tri_self_transpose.hpp.
|
inline |
Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose.
| x | Matrix to multiply. |
Definition at line 21 of file multiply_lower_tri_self_transpose.hpp.
|
inline |
Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose.
| A | Matrix to multiply. |
Definition at line 23 of file multiply_lower_tri_self_transpose.hpp.
| return_type_t<T_location, T_precision> stan::math::neg_binomial_2_cdf | ( | const T_n & | n, |
| const T_location & | mu, | ||
| const T_precision & | phi | ||
| ) |
Definition at line 24 of file neg_binomial_2_cdf.hpp.
| return_type_t<T_location, T_precision> stan::math::neg_binomial_2_lccdf | ( | const T_n & | n, |
| const T_location & | mu, | ||
| const T_precision & | phi | ||
| ) |
Definition at line 17 of file neg_binomial_2_lccdf.hpp.
| return_type_t<T_location, T_precision> stan::math::neg_binomial_2_lcdf | ( | const T_n & | n, |
| const T_location & | mu, | ||
| const T_precision & | phi | ||
| ) |
Definition at line 18 of file neg_binomial_2_lcdf.hpp.
|
inline |
Definition at line 248 of file neg_binomial_2_log_glm_lpmf.hpp.
| return_type_t<T_log_location, T_precision> stan::math::neg_binomial_2_log_lpmf | ( | const T_n & | n, |
| const T_log_location & | eta, | ||
| const T_precision & | phi | ||
| ) |
Definition at line 28 of file neg_binomial_2_log_lpmf.hpp.
|
inline |
Definition at line 135 of file neg_binomial_2_log_lpmf.hpp.
| return_type_t<T_location, T_precision> stan::math::neg_binomial_2_lpmf | ( | const T_n & | n, |
| const T_location & | mu, | ||
| const T_precision & | phi | ||
| ) |
Definition at line 25 of file neg_binomial_2_lpmf.hpp.
|
inline |
Definition at line 120 of file neg_binomial_2_lpmf.hpp.
| return_type_t<T_shape, T_inv_scale> stan::math::neg_binomial_cdf | ( | const T_n & | n, |
| const T_shape & | alpha, | ||
| const T_inv_scale & | beta | ||
| ) |
Definition at line 25 of file neg_binomial_cdf.hpp.
| return_type_t<T_shape, T_inv_scale> stan::math::neg_binomial_lccdf | ( | const T_n & | n, |
| const T_shape & | alpha, | ||
| const T_inv_scale & | beta_param | ||
| ) |
Definition at line 27 of file neg_binomial_lccdf.hpp.
| return_type_t<T_shape, T_inv_scale> stan::math::neg_binomial_lcdf | ( | const T_n & | n, |
| const T_shape & | alpha, | ||
| const T_inv_scale & | beta_param | ||
| ) |
Definition at line 27 of file neg_binomial_lcdf.hpp.
| return_type_t<T_shape, T_inv_scale> stan::math::neg_binomial_lpmf | ( | const T_n & | n, |
| const T_shape & | alpha, | ||
| const T_inv_scale & | beta | ||
| ) |
Definition at line 33 of file neg_binomial_lpmf.hpp.
|
inline |
Definition at line 125 of file neg_binomial_lpmf.hpp.
|
inline |
Return the specified complex number multiplied by -i.
This compound function is more efficient than mulitplying by the constant -i because it involves only a single arithmetic negation.
| value | type of complex argument |
| [in] | z | complex argument |
-i Definition at line 36 of file i_times.hpp.
|
inlinestatic |
|
inlinestatic |
Definition at line 10 of file nested_size.hpp.
|
inline |
Definition at line 217 of file normal_id_glm_lpdf.hpp.
|
inline |
Definition at line 24 of file normal_lccdf.hpp.
|
inline |
Definition at line 27 of file normal_lcdf.hpp.
|
inline |
Definition at line 110 of file normal_lpdf.hpp.
|
inline |
Definition at line 157 of file normal_sufficient_lpdf.hpp.
|
inlinestatic |
Return (quiet) not-a-number.
Definition at line 213 of file constants.hpp.
| size_t stan::math::num_elements | ( | const T & | m | ) |
Returns the number of the elements of a matrix_cl or var_value<matrix_cl<T>>.
| m | input to determine size of |
Definition at line 18 of file num_elements.hpp.
|
inline |
Returns 1, the number of elements in a primitive type.
Returns the size of the specified matrix.
| T | scalar type |
| x | Argument of primitive type. |
| T | type of the matrix |
| m | argument matrix |
Definition at line 19 of file num_elements.hpp.
|
inline |
Returns the number of elements in the specified vector.
This assumes it is not ragged and that each of its contained elements has the same number of elements.
| T | type of elements in the vector |
| v | argument vector |
Definition at line 46 of file num_elements.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, T_Args...>, Eigen::Dynamic, 1> > stan::math::ode_adams | ( | const F & | f, |
| const T_y0 & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| std::ostream * | msgs, | ||
| const T_Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the non-stiff Adams-Moulton solver in CVODES with defaults for relative_tolerance, absolute_tolerance, and max_num_steps.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and not less than t0. | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 148 of file ode_adams.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, T_Args...>, Eigen::Dynamic, 1> > stan::math::ode_adams_tol | ( | const F & | f, |
| const T_y0 & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance, | ||
| double | absolute_tolerance, | ||
| long int | max_num_steps, | ||
| std::ostream * | msgs, | ||
| const T_Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the non-stiff Adams-Moulton solver from CVODES.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and not less than t0. | |
| relative_tolerance | Relative tolerance passed to CVODES | |
| absolute_tolerance | Absolute tolerance passed to CVODES | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 105 of file ode_adams.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, T_Args...>, Eigen::Dynamic, 1> > stan::math::ode_adams_tol_impl | ( | const char * | function_name, |
| const F & | f, | ||
| const T_y0 & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance, | ||
| double | absolute_tolerance, | ||
| long int | max_num_steps, | ||
| std::ostream * | msgs, | ||
| const T_Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the non-stiff Adams-Moulton solver from CVODES.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| function_name | Calling function name (for printing debugging messages) | |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and not less than t0. | |
| relative_tolerance | Relative tolerance passed to CVODES | |
| absolute_tolerance | Absolute tolerance passed to CVODES | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 51 of file ode_adams.hpp.
| auto stan::math::ode_adjoint_impl | ( | const char * | function_name, |
| F && | f, | ||
| const T_y0 & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance_forward, | ||
| const T_abs_tol_fwd & | absolute_tolerance_forward, | ||
| double | relative_tolerance_backward, | ||
| const T_abs_tol_bwd & | absolute_tolerance_backward, | ||
| double | relative_tolerance_quadrature, | ||
| double | absolute_tolerance_quadrature, | ||
| long int | max_num_steps, | ||
| long int | num_steps_between_checkpoints, | ||
| int | interpolation_polynomial, | ||
| int | solver_forward, | ||
| int | solver_backward, | ||
| std::ostream * | msgs, | ||
| const T_Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the stiff backward differentiation formula BDF solver or the non-stiff Adams solver from CVODES. The ODE system is integrated using the adjoint sensitivity approach of CVODES.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_y0 | Type of initial state |
| T_t0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| function_name | Calling function name (for printing debugging messages) | |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and not less than t0. | |
| relative_tolerance_forward | Relative tolerance for forward problem passed to CVODES | |
| absolute_tolerance_forward | Absolute tolerance per ODE state for forward problem passed to CVODES | |
| relative_tolerance_backward | Relative tolerance for backward problem passed to CVODES | |
| absolute_tolerance_backward | Absolute tolerance per ODE state for backward problem passed to CVODES | |
| relative_tolerance_quadrature | Relative tolerance for quadrature problem passed to CVODES | |
| absolute_tolerance_quadrature | Absolute tolerance for quadrature problem passed to CVODES | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| num_steps_between_checkpoints | Number of integrator steps after which a checkpoint is stored for the backward pass | |
| interpolation_polynomial | type of polynomial used for interpolation | |
| solver_forward | solver used for forward pass | |
| solver_backward | solver used for backward pass | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
std::vector of Eigen column vectors with scalars equal to the least upper bound of T_y0, T_t0, T_ts, and the lambda's arguments. This represents the solution to ODE at times ts Definition at line 71 of file ode_adjoint.hpp.
| std::vector<Eigen::VectorXd> stan::math::ode_adjoint_impl | ( | const char * | function_name, |
| F && | f, | ||
| const T_y0 & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance_forward, | ||
| const T_abs_tol_fwd & | absolute_tolerance_forward, | ||
| double | relative_tolerance_backward, | ||
| const T_abs_tol_bwd & | absolute_tolerance_backward, | ||
| double | relative_tolerance_quadrature, | ||
| double | absolute_tolerance_quadrature, | ||
| long int | max_num_steps, | ||
| long int | num_steps_between_checkpoints, | ||
| int | interpolation_polynomial, | ||
| int | solver_forward, | ||
| int | solver_backward, | ||
| std::ostream * | msgs, | ||
| const T_Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the stiff backward differentiation formula BDF solver or the non-stiff Adams solver from CVODES. The ODE system is integrated using the adjoint sensitivity approach of CVODES. This implementation handles the case of a double return type which ensures that no resources are left on the AD stack.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_y0 | Type of initial state |
| T_t0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| function_name | Calling function name (for printing debugging messages) | |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and not less than t0. | |
| relative_tolerance_forward | Relative tolerance for forward problem passed to CVODES | |
| absolute_tolerance_forward | Absolute tolerance per ODE state for forward problem passed to CVODES | |
| relative_tolerance_backward | Relative tolerance for backward problem passed to CVODES | |
| absolute_tolerance_backward | Absolute tolerance per ODE state for backward problem passed to CVODES | |
| relative_tolerance_quadrature | Relative tolerance for quadrature problem passed to CVODES | |
| absolute_tolerance_quadrature | Absolute tolerance for quadrature problem passed to CVODES | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| num_steps_between_checkpoints | Number of integrator steps after which a checkpoint is stored for the backward pass | |
| interpolation_polynomial | type of polynomial used for interpolation | |
| solver_forward | solver used for forward pass | |
| solver_backward | solver used for backward pass | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
std::vector of Eigen column vectors with scalars equal to the least upper bound of T_y0, T_t0, T_ts, and the lambda's arguments. This represents the solution to ODE at times ts Definition at line 155 of file ode_adjoint.hpp.
| auto stan::math::ode_adjoint_tol_ctl | ( | F && | f, |
| const T_y0 & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance_forward, | ||
| const T_abs_tol_fwd & | absolute_tolerance_forward, | ||
| double | relative_tolerance_backward, | ||
| const T_abs_tol_bwd & | absolute_tolerance_backward, | ||
| double | relative_tolerance_quadrature, | ||
| double | absolute_tolerance_quadrature, | ||
| long int | max_num_steps, | ||
| long int | num_steps_between_checkpoints, | ||
| int | interpolation_polynomial, | ||
| int | solver_forward, | ||
| int | solver_backward, | ||
| std::ostream * | msgs, | ||
| const T_Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the stiff backward differentiation formula BDF solver or the non-stiff Adams solver from CVODES. The ODE system is integrated using the adjoint sensitivity approach of CVODES.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_y0 | Type of initial state |
| T_t0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and not less than t0. | |
| relative_tolerance_forward | Relative tolerance for forward problem passed to CVODES | |
| absolute_tolerance_forward | Absolute tolerance per ODE state for forward problem passed to CVODES | |
| relative_tolerance_backward | Relative tolerance for backward problem passed to CVODES | |
| absolute_tolerance_backward | Absolute tolerance per ODE state for backward problem passed to CVODES | |
| relative_tolerance_quadrature | Relative tolerance for quadrature problem passed to CVODES | |
| absolute_tolerance_quadrature | Absolute tolerance for quadrature problem passed to CVODES | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| num_steps_between_checkpoints | Number of integrator steps after which a checkpoint is stored for the backward pass | |
| interpolation_polynomial | type of polynomial used for interpolation | |
| solver_forward | solver used for forward pass | |
| solver_backward | solver used for backward pass | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
std::vector of Eigen column vectors with scalars equal to the least upper bound of T_y0, T_t0, T_ts, and the lambda's arguments. This represents the solution to ODE at times ts Definition at line 243 of file ode_adjoint.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, T_Args...>, Eigen::Dynamic, 1> > stan::math::ode_bdf | ( | const F & | f, |
| const T_y0 & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| std::ostream * | msgs, | ||
| const T_Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the stiff backward differentiation formula (BDF) solver in CVODES with defaults for relative_tolerance, absolute_tolerance, and max_num_steps.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and not less than t0. | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 149 of file ode_bdf.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, T_Args...>, Eigen::Dynamic, 1> > stan::math::ode_bdf_tol | ( | const F & | f, |
| const T_y0 & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance, | ||
| double | absolute_tolerance, | ||
| long int | max_num_steps, | ||
| std::ostream * | msgs, | ||
| const T_Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the stiff backward differentiation formula BDF solver from CVODES.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and not less than t0. | |
| relative_tolerance | Relative tolerance passed to CVODES | |
| absolute_tolerance | Absolute tolerance passed to CVODES | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 106 of file ode_bdf.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, T_Args...>, Eigen::Dynamic, 1> > stan::math::ode_bdf_tol_impl | ( | const char * | function_name, |
| const F & | f, | ||
| const T_y0 & | y0, | ||
| const T_t0 & | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance, | ||
| double | absolute_tolerance, | ||
| long int | max_num_steps, | ||
| std::ostream * | msgs, | ||
| const T_Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the stiff backward differentiation formula BDF solver from CVODES.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_y0 | Type of initial state |
| T_t0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| function_name | Calling function name (for printing debugging messages) | |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and not less than t0. | |
| relative_tolerance | Relative tolerance passed to CVODES | |
| absolute_tolerance | Absolute tolerance passed to CVODES | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 52 of file ode_bdf.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, Args...>, Eigen::Dynamic, 1> > stan::math::ode_ckrk | ( | const F & | f, |
| const T_y0 & | y0, | ||
| T_t0 | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| std::ostream * | msgs, | ||
| const Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using Boost's Cash-Karp Runge-Kutta solver with defaults for relative_tolerance, absolute_tolerance, and max_num_steps.
If the system of equations is stiff, ode_bdf will likely be faster.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_y0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and greather than t0. | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 245 of file ode_ckrk.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, Args...>, Eigen::Dynamic, 1> > stan::math::ode_ckrk_tol | ( | const F & | f, |
| const T_y0 & | y0_arg, | ||
| T_t0 | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance, | ||
| double | absolute_tolerance, | ||
| long int | max_num_steps, | ||
| std::ostream * | msgs, | ||
| const Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using Boost's Cash-Karp solver.
If the system of equations is stiff, ode_bdf will likely be faster.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| y0_arg | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and greater than t0. | |
| relative_tolerance | Relative tolerance passed to Boost | |
| absolute_tolerance | Absolute tolerance passed to Boost | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 199 of file ode_ckrk.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, Args...>, Eigen::Dynamic, 1> > stan::math::ode_ckrk_tol_impl | ( | const char * | function_name, |
| const F & | f, | ||
| const T_y0 & | y0_arg, | ||
| T_t0 | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance, | ||
| double | absolute_tolerance, | ||
| long int | max_num_steps, | ||
| std::ostream * | msgs, | ||
| const Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using Boost's Cash-Karp54 solver.
If the system of equations is stiff, ode_bdf will likely be faster.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_y0 | Type of initial condition |
| T_t0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| function_name | Calling function name (for printing debugging messages) | |
| f | Right hand side of the ODE | |
| y0_arg | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and greater than t0. | |
| relative_tolerance | Relative tolerance passed to Boost | |
| absolute_tolerance | Absolute tolerance passed to Boost | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 58 of file ode_ckrk.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, Args...>, Eigen::Dynamic, 1> > stan::math::ode_rk45 | ( | const F & | f, |
| const T_y0 & | y0, | ||
| T_t0 | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| std::ostream * | msgs, | ||
| const Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the non-stiff Runge-Kutta 45 solver in Boost with defaults for relative_tolerance, absolute_tolerance, and max_num_steps.
If the system of equations is stiff, ode_bdf will likely be faster.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_y0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| y0 | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and greather than t0. | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 247 of file ode_rk45.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, Args...>, Eigen::Dynamic, 1> > stan::math::ode_rk45_tol | ( | const F & | f, |
| const T_y0 & | y0_arg, | ||
| T_t0 | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance, | ||
| double | absolute_tolerance, | ||
| long int | max_num_steps, | ||
| std::ostream * | msgs, | ||
| const Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the non-stiff Runge-Kutta 45 solver in Boost.
If the system of equations is stiff, ode_bdf will likely be faster.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| y0_arg | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and greater than t0. | |
| relative_tolerance | Relative tolerance passed to Boost | |
| absolute_tolerance | Absolute tolerance passed to Boost | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 201 of file ode_rk45.hpp.
| std::vector<Eigen::Matrix<stan::return_type_t<T_y0, T_t0, T_ts, Args...>, Eigen::Dynamic, 1> > stan::math::ode_rk45_tol_impl | ( | const char * | function_name, |
| const F & | f, | ||
| const T_y0 & | y0_arg, | ||
| T_t0 | t0, | ||
| const std::vector< T_ts > & | ts, | ||
| double | relative_tolerance, | ||
| double | absolute_tolerance, | ||
| long int | max_num_steps, | ||
| std::ostream * | msgs, | ||
| const Args &... | args | ||
| ) |
Solve the ODE initial value problem y' = f(t, y), y(t0) = y0 at a set of times, { t1, t2, t3, ...
} using the non-stiff Runge-Kutta 45 solver in Boost.
If the system of equations is stiff, ode_bdf will likely be faster.
f must define an operator() with the signature as: template<typename T_t, typename T_y, typename... T_Args> Eigen::Matrix<stan::return_type_t<T_t, T_y, T_Args...>, Eigen::Dynamic, 1> operator()(const T_t& t, const Eigen::Matrix<T_y, Eigen::Dynamic, 1>& y, std::ostream* msgs, const T_Args&... args);
t is the time, y is the vector-valued state, msgs is a stream for error messages, and args are optional arguments passed to the ODE solve function (which are passed through to f without modification).
| F | Type of ODE right hand side |
| T_y0 | Type of initial condition |
| T_t0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| function_name | Calling function name (for printing debugging messages) | |
| f | Right hand side of the ODE | |
| y0_arg | Initial state | |
| t0 | Initial time | |
| ts | Times at which to solve the ODE at. All values must be sorted and greater than t0. | |
| relative_tolerance | Relative tolerance passed to Boost | |
| absolute_tolerance | Absolute tolerance passed to Boost | |
| max_num_steps | Upper limit on the number of integration steps to take between each output (error if exceeded) | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
ts Definition at line 59 of file ode_rk45.hpp.
| Eigen::VectorXd stan::math::ode_store_sensitivities | ( | const F & | f, |
| const std::vector< double > & | coupled_state, | ||
| const Eigen::Matrix< T_y0_t0, Eigen::Dynamic, 1 > & | y0, | ||
| T_t0 | t0, | ||
| T_t | t, | ||
| std::ostream * | msgs, | ||
| const Args &... | args | ||
| ) |
When all arguments are arithmetic, there are no sensitivities to store, so the function just returns the current coupled_state.
| F | Type of ODE right hand side |
| T_y0_t0 | Type of initial state |
| T_t0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| coupled_state | Current state of the coupled_ode_system | |
| y0 | Initial state | |
| t0 | Initial time | |
| t | Times at which to solve the ODE at | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
Definition at line 35 of file ode_store_sensitivities.hpp.
| Eigen::Matrix<var, Eigen::Dynamic, 1> stan::math::ode_store_sensitivities | ( | const F & | f, |
| const std::vector< double > & | coupled_state, | ||
| const Eigen::Matrix< T_y0_t0, Eigen::Dynamic, 1 > & | y0, | ||
| const T_t0 & | t0, | ||
| const T_t & | t, | ||
| std::ostream * | msgs, | ||
| const Args &... | args | ||
| ) |
Build output vars for a state of the ODE solve, storing the sensitivities precomputed using the forward sensitivity problem in precomputed varis.
| F | Type of ODE right hand side |
| T_y0_t0 | Type of initial state |
| T_t0 | Type of initial time |
| T_ts | Type of output times |
| T_Args | Types of pass-through parameters |
| f | Right hand side of the ODE | |
| coupled_state | Current state of the coupled_ode_system | |
| y0 | Initial state | |
| t0 | Initial time | |
| t | Times at which to solve the ODE at | |
| [in,out] | msgs | the print stream for warning messages |
| args | Extra arguments passed unmodified through to ODE right hand side |
Definition at line 36 of file ode_store_sensitivities.hpp.
|
inline |
Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.
The transform applied is
\(f(x) = mu + sigma * x\)
where mu is the offset and sigma is the multiplier.
If the offset is zero and the multiplier is one this reduces to identity_constrain(x).
| T | type of unconstrained input |
| M | type of offset |
| S | type of multiplier |
| [in] | x | Unconstrained input |
| [in] | mu | offset of constrained output |
| [in] | sigma | multiplier of constrained output |
| std::domain_error | if sigma <= 0 |
| std::domain_error | if mu is not finite |
Definition at line 38 of file offset_multiplier_constrain.hpp.
|
inline |
Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.
The transform applied is
\(f(x) = mu + sigma * x\)
where mu is the offset and sigma is the multiplier.
If the offset is zero and the multiplier is one this reduces to identity_constrain(x).
| T | type of unconstrained input |
| M | type of offset |
| S | type of multiplier |
| [in] | A | Unconstrained input |
| [in] | mu | offset of constrained output |
| [in] | sigma | multiplier of constrained output |
| std::domain_error | if sigma <= 0 |
| std::domain_error | if mu is not finite |
Definition at line 40 of file offset_multiplier_constrain.hpp.
|
inline |
Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.
The transform applied is
\(f(x) = mu + sigma * x\)
where mu is the offset and sigma is the multiplier.
If the offset is zero and the multiplier is one this reduces to identity_constrain(x).
| T | type of scalar |
| M | type of offset |
| S | type of multiplier |
| [in] | x | Unconstrained scalar input |
| [in] | mu | offset of constrained output |
| [in] | sigma | multiplier of constrained output |
| std::domain_error | if sigma <= 0 |
| std::domain_error | if mu is not finite |
Definition at line 43 of file offset_multiplier_constrain.hpp.
|
inline |
Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.
The transform applied is
\(f(x) = mu + sigma * x\)
where mu is the offset and sigma is the multiplier.
If the offset is zero and the multiplier is one this reduces to identity_constrain(x).
| T | type of unconstrained input |
| M | type of offset |
| S | type of multiplier |
| [in] | x | Unconstrained input |
| [in] | mu | offset of constrained output |
| [in] | sigma | multiplier of constrained output |
| [in,out] | lp | Reference to log probability to increment. |
| std::domain_error | if sigma <= 0 |
| std::domain_error | if mu is not finite |
Definition at line 79 of file offset_multiplier_constrain.hpp.
|
inline |
Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.
The transform applied is
\(f(x) = mu + sigma * x\)
where mu is the offset and sigma is the multiplier.
If the offset is zero and the multiplier is one this reduces to identity_constrain(x).
| T | type of unconstrained input |
| M | type of offset |
| S | type of multiplier |
| [in] | A | Unconstrained input |
| [in] | mu | offset of constrained output |
| [in] | sigma | multiplier of constrained output |
| [in,out] | lp | Reference to log probability to increment. |
| std::domain_error | if sigma <= 0 |
| std::domain_error | if mu is not finite |
Definition at line 87 of file offset_multiplier_constrain.hpp.
|
inline |
Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier, incrementing the specified reference with the log absolute Jacobian determinant of the transform.
Return the linearly transformed value for the specified unconstrained input and specified offset and multiplier.
The transform applied is
\(f(x) = mu + sigma * x\)
where mu is the offset and sigma is the multiplier.
If the offset is zero and multiplier is one, this function reduces to identity_constraint(x, lp).
| T | type of scalar |
| M | type of offset |
| S | type of multiplier |
| [in] | x | Unconstrained scalar input |
| [in] | mu | offset of constrained output |
| [in] | sigma | multiplier of constrained output |
| [in,out] | lp | Reference to log probability to increment. |
| std::domain_error | if sigma <= 0 |
| std::domain_error | if mu is not finite |
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| M | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| S | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| [in] | x | Unconstrained scalar input |
| [in] | mu | offset of constrained output |
| [in] | sigma | multiplier of constrained output |
| [in,out] | lp | log density accumulator |
| std::domain_error | if sigma <= 0 |
| std::domain_error | if mu is not finite |
Definition at line 92 of file offset_multiplier_constrain.hpp.
|
inline |
Overload for array of x and non-array mu and sigma.
Definition at line 122 of file offset_multiplier_constrain.hpp.
|
inline |
Overload for array of x and non-array mu and sigma with lp.
Definition at line 141 of file offset_multiplier_constrain.hpp.
|
inline |
Overload for array of x and sigma and non-array mu.
Definition at line 161 of file offset_multiplier_constrain.hpp.
|
inline |
Overload for array of x and sigma and non-array mu with lp.
Definition at line 180 of file offset_multiplier_constrain.hpp.
|
inline |
Overload for array of x and mu and non-array sigma.
Definition at line 200 of file offset_multiplier_constrain.hpp.
|
inline |
Overload for array of x and mu and non-array sigma with lp.
Definition at line 220 of file offset_multiplier_constrain.hpp.
|
inline |
Overload for array of x, mu, and sigma.
Definition at line 240 of file offset_multiplier_constrain.hpp.
|
inline |
Overload for array of x, mu, and sigma with lp.
Definition at line 259 of file offset_multiplier_constrain.hpp.
|
inline |
Return the unconstrained variable that transforms to the specified offset and multiplier constrained variable given the specified offset and multiplier.
The transform in locmultiplier_constrain(T, double, double), is reversed by the reverse affine transformation,
\(f^{-1}(y) = \frac{y - L}{S}\)
where \(L\) and \(S\) are the offset and multiplier.
If the offset is zero and multiplier is one, this function reduces to identity_free(y).
| T | type of constrained variable |
| L | type of offset |
| S | type of multiplier |
| y | constrained value | |
| [in] | mu | offset of constrained output |
| [in] | sigma | multiplier of constrained output |
| std::domain_error | if sigma <= 0 |
| std::domain_error | if mu is not finite |
| std::invalid_argument | if non-scalar arguments don't match in size |
Definition at line 42 of file offset_multiplier_free.hpp.
|
inline |
Overload for array of x and non-array mu and sigma.
Definition at line 66 of file offset_multiplier_free.hpp.
|
inline |
Overload for array of x and sigma and non-array mu.
Definition at line 84 of file offset_multiplier_free.hpp.
|
inline |
Overload for array of x and mu and non-array sigma.
Definition at line 103 of file offset_multiplier_free.hpp.
|
inline |
Overload for array of x, mu, and sigma.
Definition at line 121 of file offset_multiplier_free.hpp.
|
inline |
Return an array with 1 in the k-th position and zero elsewhere.
| K | size of the array |
| k | position of the 1 (indexing from 1) |
| std::domain_error | if K is not positive, or if k is less than 1 or greater than K. |
Definition at line 20 of file one_hot_array.hpp.
|
inline |
Return an integer array with 1 in the k-th position and zero elsewhere.
| K | size of the array |
| k | position of the 1 (indexing from 1) |
| std::domain_error | if K is not positive, or if k is less than 1 or greater than K. |
Definition at line 20 of file one_hot_int_array.hpp.
|
inline |
Return a row vector with 1 in the k-th position and zero elsewhere.
| K | size of the row vector |
| k | position of the 1 (indexing from 1) |
| std::domain_error | if K is not positive, or if k is less than 1 or greater than K. |
Definition at line 20 of file one_hot_row_vector.hpp.
|
inline |
Return a vector with 1 in the k-th position and zero elsewhere.
| K | size of the vector |
| k | position of the 1 (indexing from 1) |
| std::domain_error | if K is not positive, or if k is less than 1 or greater than K. |
Definition at line 20 of file one_hot_vector.hpp.
|
inline |
Return an array of ones.
| K | size of the array |
| std::domain_error | if K is negative. |
Definition at line 17 of file ones_array.hpp.
|
inline |
Return an integer array of ones.
| K | size of the array |
| std::domain_error | if K is negative. |
Definition at line 17 of file ones_int_array.hpp.
|
inline |
Return a row vector of ones.
| K | size of the row vector |
| std::domain_error | if K is negative. |
Definition at line 17 of file ones_row_vector.hpp.
|
inline |
Return a vector of ones.
| K | size of the vector |
| std::domain_error | if K is negative. |
Definition at line 17 of file ones_vector.hpp.
|
inline |
Return the negation of the value of the argument as defined by !.
| [in] | x | argument |
Definition at line 17 of file operator_unary_not.hpp.
|
inline |
Return the negation of the value of the argument as defined by !.
| value | and tangent type for variables |
| [in] | x | argument |
Definition at line 18 of file operator_unary_not.hpp.
|
inline |
Logical negation of a kernel generator expression.
| T | type of the argument |
| a | argument expression |
Definition at line 109 of file unary_operation_cl.hpp.
|
inline |
Return true if the value of the two arguments are not equal as defined by !=.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 19 of file operator_not_equal.hpp.
|
inline |
Return true if the complex numbers have unequal imaginary or complex parts.
| U | value type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
true if the arguments are equal Definition at line 21 of file operator_not_equal.hpp.
|
inline |
Inequality operator comparing two variables' values (C++).
\[ \mbox{operator!=}(x, y) = \begin{cases} 0 & \mbox{if } x = y\\ 1 & \mbox{if } x \neq y \\[6pt] 0 & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Definition at line 30 of file operator_not_equal.hpp.
| auto stan::math::operator!= | ( | const T_a & | a, |
| const T_b & | b | ||
| ) |
Definition at line 32 of file eigen_comparisons.hpp.
|
inline |
Return true if the value of the first argument is not equal to the second argument as defined by !=.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 34 of file operator_not_equal.hpp.
|
inline |
Return true if the first argument's real part is unequal to the second argument or the first argument's imaginary part is unequal to zero.
| U | value type of first argument |
| V | type of second argument |
| x | first argument |
| y | second argument |
true if the arguments are equal Definition at line 37 of file operator_not_equal.hpp.
|
inline |
Inequality operator comparing a variable's value and a double (C++).
| Arith | An arithmetic type |
| a | First variable. |
| b | Second value. |
Definition at line 45 of file operator_not_equal.hpp.
|
inline |
Return true if the first argument is not equal to the value of the second argument as defined by !=.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 49 of file operator_not_equal.hpp.
|
inline |
Return true if the first argument is unequal to the real part of the second argument or the imaginary part of the second argument is nonzero.
| U | type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
true if the arguments are not equal Definition at line 53 of file operator_not_equal.hpp.
|
inline |
Inequality operator comparing a double and a variable's value (C++).
| Arith | An arithmetic type |
| a | First value. |
| b | Second variable. |
Definition at line 60 of file operator_not_equal.hpp.
|
inline |
Return false if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero.
| x | real number |
| z | complex number |
false if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero Definition at line 73 of file operator_not_equal.hpp.
|
inline |
Return false if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero.
| z | complex number |
| y | real number |
false if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero Definition at line 86 of file operator_not_equal.hpp.
Return the logical conjunction of the values of the two arguments as defined by &&.
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 18 of file operator_logical_and.hpp.
|
inline |
Return the logical conjunction of the values of the two arguments as defined by &&.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 19 of file operator_logical_and.hpp.
|
inline |
Return the logical conjunction of the values of the two arguments as defined by &&.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 34 of file operator_logical_and.hpp.
|
inline |
Return the logical conjunction of the values of the two arguments as defined by &&.
| Var | value type of a var |
| Arith | An arithmetic type |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 34 of file operator_logical_and.hpp.
|
inline |
Return the logical conjunction of the values of the two arguments as defined by &&.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 49 of file operator_logical_and.hpp.
|
inline |
Return the logical conjunction of the values of the two arguments as defined by &&.
| Var | value type of a var |
| Arith | An arithmetic type |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 50 of file operator_logical_and.hpp.
|
inline |
Return the product of the two arguments.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 18 of file operator_multiplication.hpp.
Return the product of the two arguments.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 31 of file operator_multiplication.hpp.
|
inline |
Return the product of the arguments.
| U | value type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
Definition at line 39 of file operator_multiplication.hpp.
Return the product of the two arguments.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 44 of file operator_multiplication.hpp.
|
inline |
Return the product of the arguments.
| U | value type of first argument |
| V | type of second argument |
| x | first argument |
| y | second argument |
Definition at line 54 of file operator_multiplication.hpp.
|
inline |
Matrix multiplication of two reverse mode matrices and/or kernel generator expressions.
| T_a | type of first expression |
| T_b | type of second expression |
| A | first expression |
| B | second expression |
Definition at line 62 of file multiply.hpp.
|
inline |
Return the product of the arguments.
| U | type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
Definition at line 68 of file operator_multiplication.hpp.
Multiplication operator for two variables (C++).
The partial derivatives are
\(\frac{\partial}{\partial x} (x * y) = y\), and
\(\frac{\partial}{\partial y} (x * y) = x\).
\[ \mbox{operator*}(x, y) = \begin{cases} xy & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator*}(x, y)}{\partial x} = \begin{cases} y & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator*}(x, y)}{\partial y} = \begin{cases} x & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 71 of file operator_multiplication.hpp.
|
inline |
Multiplication operator for a variable and a scalar (C++).
The partial derivative for the variable is
\(\frac{\partial}{\partial x} (x * c) = c\), and
| Arith | An arithmetic type |
| a | Variable operand. |
| b | Scalar operand. |
Definition at line 88 of file operator_multiplication.hpp.
|
inline |
Matrix multiplication of two kernel generator expressions.
Evaluates both expressions before calculating the matrix product.
| T_a | type of first expression |
| T_b | type of second expression |
| a | first expression |
| b | second expression |
Definition at line 106 of file multiply.hpp.
|
inline |
Multiplication operator for a scalar and a variable (C++).
The partial derivative for the variable is
\(\frac{\partial}{\partial y} (c * y) = c\).
| Arith | An arithmetic type |
| a | Scalar operand. |
| b | Variable operand. |
Definition at line 108 of file operator_multiplication.hpp.
| T1 stan::math::operator*= | ( | T1 && | a, |
| T2 && | b | ||
| ) |
Definition at line 24 of file compound_assignments.hpp.
|
inline |
Return the argument.
| U | value type argument |
| x | argument |
Definition at line 18 of file operator_plus.hpp.
|
inline |
Return the sum of the specified forward mode addends.
| T | type of values and tangents |
| x1 | first addend |
| x2 | second addend |
Definition at line 18 of file operator_addition.hpp.
|
inline |
Returns the unary plus of the input.
| M | input kernel expression |
Definition at line 19 of file operator_unary_plus.hpp.
Returns the argument.
It is included for completeness. The primitive unary operator+ exists to promote integer to floating point values.
| T | value and tangent type of the argument |
| x | argument |
Definition at line 19 of file operator_unary_plus.hpp.
Return the sum of the specified double and forward mode addends.
| T | type of values and tangents |
| x1 | first addend |
| x2 | second addend |
Definition at line 31 of file operator_addition.hpp.
|
inline |
Return the sum of the arguments.
| U | value type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
Definition at line 39 of file operator_addition.hpp.
Unary plus operator for variables (C++).
The function simply returns its input, because
\(\frac{d}{dx} +x = \frac{d}{dx} x = 1\).
The effect of unary plus on a built-in C++ scalar type is integer promotion. Because variables are all double-precision floating point already, promotion is not necessary.
\[ \mbox{operator+}(x) = \begin{cases} x & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator+}(x)}{\partial x} = \begin{cases} 1 & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Argument variable. |
Definition at line 44 of file operator_unary_plus.hpp.
Return the sum of the specified forward mode and double addends.
| T | type of values and tangents |
| x1 | first addend |
| x2 | second addend |
Definition at line 44 of file operator_addition.hpp.
Addition operator for variables (C++).
The partial derivatives are defined by
\(\frac{\partial}{\partial x} (x+y) = 1\), and
\(\frac{\partial}{\partial y} (x+y) = 1\).
\[ \mbox{operator+}(x, y) = \begin{cases} x+y & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator+}(x, y)}{\partial x} = \begin{cases} 1 & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator+}(x, y)}{\partial y} = \begin{cases} 1 & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 53 of file operator_addition.hpp.
|
inline |
Return the sum of the arguments.
| U | value type of first argument |
| V | type of second argument |
| x | first argument |
| y | second argument |
Definition at line 54 of file operator_addition.hpp.
|
inline |
|
inline |
Return the sum of the arguments.
| U | type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
Definition at line 68 of file operator_addition.hpp.
|
inline |
Addition operator for variable and scalar (C++).
The derivative with respect to the variable is
\(\frac{d}{dx} (x + c) = 1\).
| Arith | An arithmetic type |
| a | First variable operand. |
| b | Second scalar operand. |
Definition at line 74 of file operator_addition.hpp.
|
inline |
Addition operator for scalar and variable (C++).
The derivative with respect to the variable is
\(\frac{d}{dy} (c + y) = 1\).
| Arith | An arithmetic type |
| a | First scalar operand. |
| b | Second variable operand. |
Definition at line 96 of file operator_addition.hpp.
|
inline |
Addition operator for matrix variables.
| VarMat1 | A matrix of vars or a var with an underlying matrix type. |
| VarMat2 | A matrix of vars or a var with an underlying matrix type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 277 of file operator_addition.hpp.
Prefix increment operator for variables (C++).
Following C++, (++a) is defined to behave exactly as (a = a + 1.0) does, but is faster and uses less memory. In particular, the result is an assignable lvalue.
| a | Variable to increment. |
Definition at line 22 of file operator_unary_increment.hpp.
Postfix increment operator for variables (C++).
Following C++, the expression (a++) is defined to behave like the sequence of operations
var temp = a; a = a + 1.0; return temp;
| a | Variable to increment. |
Definition at line 38 of file operator_unary_increment.hpp.
| T1 stan::math::operator+= | ( | T1 && | a, |
| T2 && | b | ||
| ) |
Definition at line 22 of file compound_assignments.hpp.
Return the negation of the specified argument.
| value | and tangent type of the argument |
| [in] | x | argument |
Definition at line 17 of file operator_unary_minus.hpp.
|
inline |
Return the difference of the specified arguments.
| T | type of values and tangents |
| x1 | first argument |
| x2 | second argument |
Definition at line 18 of file operator_subtraction.hpp.
|
inline |
Return the negation of the argument.
| U | value type argument |
| x | argument |
Definition at line 18 of file operator_minus.hpp.
|
inline |
Returns the unary minus of the input.
| M | input kernel expression |
Definition at line 19 of file operator_unary_minus.hpp.
Return the difference of the specified arguments.
| T | type of values and tangents |
| x1 | first argument |
| x2 | second argument |
Definition at line 31 of file operator_subtraction.hpp.
Unary negation operator for variables (C++).
\(\frac{d}{dx} -x = -1\).
\[ \mbox{operator-}(x) = \begin{cases} -x & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator-}(x)}{\partial x} = \begin{cases} -1 & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Argument variable. |
Definition at line 37 of file operator_unary_negative.hpp.
|
inline |
Return the difference of the arguments.
| U | value type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
Definition at line 39 of file operator_subtraction.hpp.
Return the difference of the specified arguments.
| T | type of values and tangents |
| x1 | first argument |
| x2 | second argument |
Definition at line 44 of file operator_subtraction.hpp.
|
inline |
Compute additive inverse of input.
| T | type of input |
| a | input |
Definition at line 50 of file operator_unary_negative.hpp.
|
inline |
Return the difference of the arguments.
| U | value type of first argument |
| V | type of second argument |
| x | first argument |
| y | second argument |
Definition at line 54 of file operator_subtraction.hpp.
|
inline |
Subtraction of two reverse mode matrices and/or kernel generator expressions.
| T_a | type of first expression |
| T_b | type of second expression |
| a | first expression |
| b | second expression |
Definition at line 55 of file subtract.hpp.
Subtraction operator for variables.
The partial derivatives are defined by
\(\frac{\partial}{\partial x} (x-y) = 1\), and
\(\frac{\partial}{\partial y} (x-y) = -1\).
\[ \mbox{operator-}(x, y) = \begin{cases} x-y & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator-}(x, y)}{\partial x} = \begin{cases} 1 & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator-}(x, y)}{\partial y} = \begin{cases} -1 & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| Var1 | value type of a var |
| Var2 | value type of a var |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 56 of file operator_subtraction.hpp.
|
inline |
Return the difference of the arguments.
| U | type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
Definition at line 68 of file operator_subtraction.hpp.
|
inline |
Subtraction operator for variable and scalar.
The derivative for the variable is
\(\frac{\partial}{\partial x} (x-c) = 1\), and
| Var | value type of a var |
| Arith | An arithmetic type |
| a | First variable operand. |
| b | Second scalar operand. |
Definition at line 78 of file operator_subtraction.hpp.
|
inline |
Subtraction operator for scalar and variable.
The derivative for the variable is
\(\frac{\partial}{\partial y} (c-y) = -1\), and
| Var | value type of a var |
| Arith | An arithmetic type |
| a | First scalar operand. |
| b | Second variable operand. |
Definition at line 101 of file operator_subtraction.hpp.
|
inline |
Unary minus of a kernel generator expression.
| T | type of the argument |
| a | argument expression |
Definition at line 162 of file unary_operation_cl.hpp.
|
inline |
Addition operator for matrix variables.
| VarMat1 | A matrix of vars or a var with an underlying matrix type. |
| VarMat2 | A matrix of vars or a var with an underlying matrix type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 309 of file operator_subtraction.hpp.
Prefix decrement operator for variables (C++).
Following C++, (–a) is defined to behave exactly as
a = a - 1.0)
does, but is faster and uses less memory. In particular, the result is an assignable lvalue.
| a | Variable to decrement. |
Definition at line 26 of file operator_unary_decrement.hpp.
Postfix decrement operator for variables (C++).
Following C++, the expression (a–) is defined to behave like the sequence of operations
var temp = a; a = a - 1.0; return temp;
| a | Variable to decrement. |
Definition at line 42 of file operator_unary_decrement.hpp.
| T1 stan::math::operator-= | ( | T1 && | a, |
| T2 && | b | ||
| ) |
Definition at line 23 of file compound_assignments.hpp.
|
inline |
Return the result of dividing the first argument by the second.
| T | type of fvar value and tangent |
| x1 | first argument |
| x2 | second argument |
Definition at line 21 of file operator_division.hpp.
|
inline |
Return the result of dividing the first argument by the second.
| T | type of fvar value and tangent |
| x1 | first argument |
| x2 | second argument |
Definition at line 35 of file operator_division.hpp.
|
inline |
Return the quotient of the arguments.
| U | value type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
Definition at line 39 of file operator_division.hpp.
|
inline |
Return the result of dividing the first argument by the second.
| T | type of fvar value and tangent |
| x1 | first argument |
| x2 | second argument |
Definition at line 49 of file operator_division.hpp.
|
inline |
Return the quotient of the arguments.
| U | value type of first argument |
| V | type of second argument |
| x | first argument |
| y | second argument |
Definition at line 54 of file operator_division.hpp.
|
inline |
Definition at line 55 of file operator_division.hpp.
|
inline |
Definition at line 60 of file operator_division.hpp.
Division operator for two variables (C++).
The partial derivatives for the variables are
\(\frac{\partial}{\partial x} (x/y) = 1/y\), and
\(\frac{\partial}{\partial y} (x/y) = -x / y^2\).
\[ \mbox{operator/}(x, y) = \begin{cases} \frac{x}{y} & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator/}(x, y)}{\partial x} = \begin{cases} \frac{1}{y} & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{operator/}(x, y)}{\partial y} = \begin{cases} -\frac{x}{y^2} & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| dividend | First variable operand. |
| divisor | Second variable operand. |
Definition at line 61 of file operator_division.hpp.
|
inline |
Definition at line 65 of file operator_division.hpp.
|
inline |
Return the quotient of the arguments.
| U | type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
Definition at line 68 of file operator_division.hpp.
|
inline |
Definition at line 70 of file operator_division.hpp.
|
inline |
Definition at line 75 of file operator_division.hpp.
|
inline |
Definition at line 80 of file operator_division.hpp.
|
inline |
Division operator for dividing a variable by a scalar (C++).
The derivative with respect to the variable is
\(\frac{\partial}{\partial x} (x/c) = 1/c\).
| Var | value type of a var |
| Arith | An arithmetic type |
| dividend | Variable operand. |
| divisor | Scalar operand. |
Definition at line 84 of file operator_division.hpp.
|
inline |
Definition at line 86 of file operator_division.hpp.
|
inline |
Definition at line 92 of file operator_division.hpp.
|
inline |
Definition at line 98 of file operator_division.hpp.
|
inline |
Division operator for dividing a scalar by a variable (C++).
The derivative with respect to the variable is
\(\frac{d}{d y} (c/y) = -c / y^2\).
| Arith | An arithmetic type |
| dividend | Scalar operand. |
| divisor | Variable operand. |
Definition at line 106 of file operator_division.hpp.
|
inline |
Definition at line 255 of file operator_division.hpp.
|
inline |
Definition at line 259 of file operator_division.hpp.
|
inline |
Return true if the first argument has a value less than the value of the second argument as defined by <.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 20 of file operator_less_than.hpp.
Less than operator comparing variables' values (C++).
\[ \mbox{operator\textless}(x, y) = \begin{cases} 0 & \mbox{if } x \geq y \\ 1 & \mbox{if } x < y \\[6pt] 0 & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Definition at line 25 of file operator_less_than.hpp.
| auto stan::math::operator< | ( | const T_a & | a, |
| const T_b & | b | ||
| ) |
Definition at line 27 of file eigen_comparisons.hpp.
|
inline |
Return true if the first argument is less than the value of the second argument as defined by <.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 35 of file operator_less_than.hpp.
|
inline |
Less than operator comparing variable's value and a double (C++).
| Arith | An arithmetic type |
| a | First variable. |
| b | Second value. |
Definition at line 37 of file operator_less_than.hpp.
|
inline |
Less than operator comparing a double and variable's value (C++).
| Arith | An arithmetic type |
| a | First value. |
| b | Second variable. |
Definition at line 51 of file operator_less_than.hpp.
|
inline |
Return true if the first argument has a value less than the second argument as defined by <.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 51 of file operator_less_than.hpp.
|
inline |
Return true if the first argument has a value less than or equal to the value of the second argument as defined by <=.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 21 of file operator_less_than_or_equal.hpp.
Less than or equal operator comparing two variables' values (C++).
\[ \mbox{operator\textless=}(x, y) = \begin{cases} 0 & \mbox{if } x > y\\ 1 & \mbox{if } x \leq y \\[6pt] 0 & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Definition at line 27 of file operator_less_than_or_equal.hpp.
| auto stan::math::operator<= | ( | const T_a & | a, |
| const T_b & | b | ||
| ) |
Definition at line 28 of file eigen_comparisons.hpp.
|
inline |
Return true if the first argument has a value less than or equal to the second argument as defined by <=.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 36 of file operator_less_than_or_equal.hpp.
|
inline |
Less than or equal operator comparing a variable's value and a scalar (C++).
| Arith | An arithmetic type |
| a | First variable. |
| b | Second value. |
Definition at line 42 of file operator_less_than_or_equal.hpp.
|
inline |
Return true if the first argument is less than or equal to the second argument's value as defined by <=.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 51 of file operator_less_than_or_equal.hpp.
|
inline |
Less than or equal operator comparing a double and variable's value (C++).
| Arith | An arithmetic type |
| a | First value. |
| b | Second variable. |
Definition at line 57 of file operator_less_than_or_equal.hpp.
|
inline |
Return true if the specified variables have equal values as defined by ==.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 19 of file operator_equal.hpp.
|
inline |
Return true if the complex numbers have equal imaginary and complex parts.
| U | value type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
true if the arguments are equal Definition at line 21 of file operator_equal_equal.hpp.
Equality operator comparing two variables' values (C++).
\[ \mbox{operator==}(x, y) = \begin{cases} 0 & \mbox{if } x \neq y\\ 1 & \mbox{if } x = y \\[6pt] 0 & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Definition at line 27 of file operator_equal.hpp.
| auto stan::math::operator== | ( | const T_a & | a, |
| const T_b & | b | ||
| ) |
Definition at line 31 of file eigen_comparisons.hpp.
|
inline |
Return true if the the first variable has a value equal to the second argument as defined by by ==.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 34 of file operator_equal.hpp.
|
inline |
Return true if the first argument's real part is equal to the second argument and the first argument's imaginary part is zero.
| U | value type of first argument |
| V | type of second argument |
| x | first argument |
| y | second argument |
true if the arguments are equal Definition at line 36 of file operator_equal_equal.hpp.
|
inline |
Equality operator comparing a variable's value and a double (C++).
| Arith | An arithmetic type |
| a | First variable. |
| b | Second value. |
Definition at line 42 of file operator_equal.hpp.
|
inline |
Return true if the the first argument is equal to the value of the second argument as defined by by ==.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 48 of file operator_equal.hpp.
|
inline |
Return true if the first argument is equal to the real part of the second argument and the imaginary part of the second argument is zero.
| U | type of first argument |
| V | value type of second argument |
| x | first argument |
| y | second argument |
true if the arguments are equal Definition at line 52 of file operator_equal_equal.hpp.
|
inline |
Equality operator comparing a scalar and a variable's value (C++).
| Arith | An arithmetic type |
| a | First scalar. |
| b | Second variable. |
Definition at line 56 of file operator_equal.hpp.
Return true if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero.
| x | real number |
| z | complex number |
true if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero Definition at line 69 of file operator_equal.hpp.
Return true if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero.
| z | complex number |
| y | real number |
true if the real number is equal to the real part of the complex number, and the imaginary part of the complex number is zero Definition at line 82 of file operator_equal.hpp.
|
inline |
Return true if the first argument has a greater value than the second as defined by >.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 20 of file operator_greater_than.hpp.
Greater than operator comparing variables' values (C++).
\[ \mbox{operator\textgreater}(x, y) = \begin{cases} 0 & \mbox{if } x \leq y\\ 1 & \mbox{if } x > y \\[6pt] 0 & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Definition at line 26 of file operator_greater_than.hpp.
| auto stan::math::operator> | ( | const T_a & | a, |
| const T_b & | b | ||
| ) |
Definition at line 29 of file eigen_comparisons.hpp.
|
inline |
Return true if the first argument has a greater value than the second as defined by >.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 35 of file operator_greater_than.hpp.
|
inline |
Greater than operator comparing variable's value and double (C++).
| Arith | An arithmetic type |
| a | First variable. |
| b | Second value. |
Definition at line 38 of file operator_greater_than.hpp.
|
inline |
Return true if the first argument has a greater value than the second as defined by >.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 50 of file operator_greater_than.hpp.
|
inline |
Greater than operator comparing a double and a variable's value (C++).
| Arith | An arithmetic type |
| a | First value. |
| b | Second variable. |
Definition at line 52 of file operator_greater_than.hpp.
|
inline |
Return true if the value of the first argument is greater than or equal to that of the second as defined by >=.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 20 of file operator_greater_than_or_equal.hpp.
Greater than or equal operator comparing two variables' values (C++).
\[ \mbox{operator\textgreater=}(x, y) = \begin{cases} 0 & \mbox{if } x < y\\ 1 & \mbox{if } x \geq y \\[6pt] 0 & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| a | First variable. |
| b | Second variable. |
Definition at line 28 of file operator_greater_than_or_equal.hpp.
| auto stan::math::operator>= | ( | const T_a & | a, |
| const T_b & | b | ||
| ) |
Definition at line 30 of file eigen_comparisons.hpp.
|
inline |
Return true if the value of the first argument has a value greater than or equal to the second argument as defined by >=.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 36 of file operator_greater_than_or_equal.hpp.
|
inline |
Greater than or equal operator comparing variable's value and double (C++).
| Arith | An arithmetic type |
| a | First variable. |
| b | Second value. |
Definition at line 43 of file operator_greater_than_or_equal.hpp.
|
inline |
Return true if the first argument is greater than or equal to the value of the second argument as defined by >=.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 52 of file operator_greater_than_or_equal.hpp.
|
inline |
Greater than or equal operator comparing double and variable's value (C++).
| Arith | An arithmetic type |
| a | First value. |
| b | Second variable. |
Definition at line 58 of file operator_greater_than_or_equal.hpp.
|
inline |
Definition at line 51 of file matrix_power.hpp.
Return the logical disjunction of the values of the two arguments as defined by ||.
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 18 of file operator_logical_or.hpp.
|
inline |
Return the logical disjunction of the values of the two arguments as defined by ||.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 19 of file operator_logical_or.hpp.
|
inline |
Return the logical disjunction of the values of the two arguments as defined by ||.
| Arith | An arithmetic type |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 33 of file operator_logical_or.hpp.
|
inline |
Return the logical disjunction of the values of the two arguments as defined by ||.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 34 of file operator_logical_or.hpp.
|
inline |
Return the logical disjunction of the values of the two arguments as defined by ||.
| Arith | An arithmetic type |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 48 of file operator_logical_or.hpp.
|
inline |
Return the logical disjunction of the values of the two arguments as defined by ||.
| value | and tangent type for variables |
| [in] | x | first argument |
| [in] | y | second argument |
Definition at line 49 of file operator_logical_or.hpp.
|
inline |
Broadcast an expression in specified dimension(s) if the size along that dimension equals 1.
In that case further expressions can use this expression as if it had any size in the broadcast dimension, repeating the values.
Broadcasting evaluates the expression argument multiple times. For performance reasons don't broadcast slow operations. Instead evaluate them in a separate kernel.
| Colwise | whether to broadcast colwise |
| Rowwise | whether to broadcast rowwise |
| T | type of input expression |
| a | input expression |
Definition at line 202 of file optional_broadcast.hpp.
|
inline |
Return an increasing ordered vector derived from the specified free vector.
The returned constrained vector will have the same dimensionality as the specified free vector.
| x | Free vector of scalars |
Definition at line 25 of file ordered_constrain.hpp.
|
inline |
Return an increasing ordered vector derived from the specified free vector.
The returned constrained vector will have the same dimensionality as the specified free vector.
| T | type of the vector |
| x | Free vector of scalars. |
| T | Type of scalar. |
Definition at line 26 of file ordered_constrain.hpp.
|
inline |
Return a positive valued, increasing ordered vector derived from the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.
The returned constrained vector will have the same dimensionality as the specified free vector.
| T | type of the vector |
| x | Free vector of scalars. |
| lp | Log probability reference. |
Definition at line 54 of file ordered_constrain.hpp.
| auto stan::math::ordered_constrain | ( | const VarVec & | x, |
| scalar_type_t< VarVec > & | lp | ||
| ) |
Return a positive valued, increasing ordered vector derived from the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.
The returned constrained vector will have the same dimensionality as the specified free vector.
| T | type of the vector |
| x | Free vector of scalars. |
| lp | Log probability reference. |
Definition at line 73 of file ordered_constrain.hpp.
|
inline |
Return a positive valued, increasing ordered vector derived from the specified free vector.
The returned constrained vector will have the same dimensionality as the specified free vector. If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| x | Free vector of scalars | |
| [in,out] | lp | log density accumulator |
The returned constrained vector will have the same dimensionality as the specified free vector. If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| x | Free vector of scalars | |
| [in,out] | lp | log density accumulator |
Definition at line 81 of file ordered_constrain.hpp.
| plain_type_t<EigVec> stan::math::ordered_free | ( | const EigVec & | y | ) |
Return the vector of unconstrained scalars that transform to the specified positive ordered vector.
This function inverts the constraining operation defined in ordered_constrain(Matrix),
| T | type of elements in the vector |
| y | Vector of positive, ordered scalars. |
| std::domain_error | if y is not a vector of positive, ordered scalars. |
Definition at line 28 of file ordered_free.hpp.
| auto stan::math::ordered_free | ( | const T & | x | ) |
Overload of ordered_free() to untransform each Eigen vector in a standard vector.
| T | A standard vector with with a value_type which inherits from Eigen::MatrixBase with compile time rows or columns equal to 1. |
| x | The standard vector to untransform. |
Definition at line 52 of file ordered_free.hpp.
| return_type_t<T_x, T_beta, T_cuts> stan::math::ordered_logistic_glm_lpmf | ( | const T_y & | y, |
| const T_x & | x, | ||
| const T_beta & | beta, | ||
| const T_cuts & | cuts | ||
| ) |
Definition at line 208 of file ordered_logistic_glm_lpmf.hpp.
| return_type_t<T_loc, T_cut> stan::math::ordered_logistic_lpmf | ( | const T_y & | y, |
| const T_loc & | lambda, | ||
| const T_cut & | c | ||
| ) |
Definition at line 208 of file ordered_logistic_lpmf.hpp.
|
inline |
Definition at line 14 of file ordered_logistic_rng.hpp.
| return_type_t<T_loc, T_cut> stan::math::ordered_probit_lpmf | ( | const T_y & | y, |
| const T_loc & | lambda, | ||
| const T_cut & | c | ||
| ) |
Definition at line 104 of file ordered_probit_lpmf.hpp.
|
inline |
Definition at line 13 of file ordered_probit_rng.hpp.
|
inline |
Throw an out_of_range exception with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing out of range. This will allow us to change the behavior for all functions at once. The message is: "<function>: index <index> out of range; expecting index to be between " "1 and <max><msg1><msg2>"
| function | Name of the function |
| max | Max |
| index | Index |
| msg1 | Message to print. Default is "". |
| msg2 | Message to print. Default is "". |
| std::out_of_range | with message. |
Definition at line 27 of file out_of_range.hpp.
|
inline |
Return Owen's T function applied to the specified arguments.
| T | inner type of the fvar |
| x1 | First argument. |
| x2 | Second argument. |
Definition at line 25 of file owens_t.hpp.
Return Owen's T function applied to the specified arguments.
| T | inner type of the fvar |
| x1 | First argument. |
| x2 | Second argument. |
Definition at line 47 of file owens_t.hpp.
|
inline |
Return the result of applying Owen's T function to the specified arguments.
Used to compute the cumulative density function for the skew normal distribution.
\[ \mbox{owens\_t}(h, a) = \begin{cases} \mbox{owens\_t}(h, a) & \mbox{if } -\infty\leq h, a \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } h = \textrm{NaN or } a = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{owens\_t}(h, a)}{\partial h} = \begin{cases} \frac{\partial\, \mbox{owens\_t}(h, a)}{\partial h} & \mbox{if } -\infty\leq h, a\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } h = \textrm{NaN or } a = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{owens\_t}(h, a)}{\partial a} = \begin{cases} \frac{\partial\, \mbox{owens\_t}(h, a)}{\partial a} & \mbox{if } -\infty\leq h, a\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } h = \textrm{NaN or } a = \textrm{NaN} \end{cases} \]
\[ \mbox{owens\_t}(h, a) = \frac{1}{2\pi} \int_0^a \frac{\exp(-\frac{1}{2}h^2(1+x^2))}{1+x^2}dx \]
\[ \frac{\partial \, \mbox{owens\_t}(h, a)}{\partial h} = -\frac{1}{2\sqrt{2\pi}} \operatorname{erf}\left(\frac{ha}{\sqrt{2}}\right) \exp\left(-\frac{h^2}{2}\right) \]
\[ \frac{\partial \, \mbox{owens\_t}(h, a)}{\partial a} = \frac{\exp\left(-\frac{1}{2}h^2(1+a^2)\right)}{2\pi (1+a^2)} \]
| h | First argument |
| a | Second argument |
Definition at line 58 of file owens_t.hpp.
The Owen's T function of h and a.
Used to compute the cumulative density function for the skew normal distribution.
| h | var parameter. |
| a | var parameter. |
Definition at line 64 of file owens_t.hpp.
Return Owen's T function applied to the specified arguments.
| T | inner type of the fvar |
| x1 | First argument. |
| x2 | Second argument. |
Definition at line 66 of file owens_t.hpp.
|
inline |
Enables the vectorised application of the owens_t function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 71 of file owens_t.hpp.
The Owen's T function of h and a.
Used to compute the cumulative density function for the skew normal distribution.
| h | var parameter. |
| a | double parameter. |
Definition at line 78 of file owens_t.hpp.
The Owen's T function of h and a.
Used to compute the cumulative density function for the skew normal distribution.
| h | double parameter. |
| a | var parameter. |
Definition at line 92 of file owens_t.hpp.
| return_type_t<T_y, T_scale, T_shape> stan::math::pareto_cdf | ( | const T_y & | y, |
| const T_scale & | y_min, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 23 of file pareto_cdf.hpp.
| return_type_t<T_y, T_scale, T_shape> stan::math::pareto_lccdf | ( | const T_y & | y, |
| const T_scale & | y_min, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 27 of file pareto_lccdf.hpp.
| return_type_t<T_y, T_scale, T_shape> stan::math::pareto_lcdf | ( | const T_y & | y, |
| const T_scale & | y_min, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 27 of file pareto_lcdf.hpp.
| return_type_t<T_y, T_scale, T_shape> stan::math::pareto_lpdf | ( | const T_y & | y, |
| const T_scale & | y_min, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 27 of file pareto_lpdf.hpp.
|
inline |
Definition at line 96 of file pareto_lpdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::pareto_type_2_cdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | lambda, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 24 of file pareto_type_2_cdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::pareto_type_2_lccdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | lambda, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 24 of file pareto_type_2_lccdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::pareto_type_2_lcdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | lambda, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 24 of file pareto_type_2_lcdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::pareto_type_2_lpdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | lambda, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 27 of file pareto_type_2_lpdf.hpp.
|
inline |
Definition at line 112 of file pareto_type_2_lpdf.hpp.
| void stan::math::partial_derivative | ( | const F & | f, |
| const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | x, | ||
| int | n, | ||
| T & | fx, | ||
| T & | dfx_dxn | ||
| ) |
Return the partial derivative of the specified multivariate function at the specified argument.
| T | Argument type |
| F | Function type |
| f | Function | |
| [in] | x | Argument vector |
| [in] | n | Index of argument with which to take derivative |
| [out] | fx | Value of function applied to argument |
| [out] | dfx_dxn | Value of partial derivative |
Definition at line 25 of file partial_derivative.hpp.
|
inline |
The unit normal cumulative distribution function.
The return value for a specified input is the probability that a random unit normal variate is less than or equal to the specified value, defined by
\(\Phi(x) = \int_{-\infty}^x \mbox{\sf Norm}(x|0, 1) \ dx\)
This function can be used to implement the inverse link function for probit regression.
Phi will underflow to 0 below -37.5 and overflow to 1 above 8
| x | Argument. |
The unit normal cumulative density function for variables (stan).
See Phi() for the double-based version.
The derivative is the unit normal density function,
\(\frac{d}{dx} \Phi(x) = \mbox{\sf Norm}(x|0, 1) = \frac{1}{\sqrt{2\pi}} \exp(-\frac{1}{2} x^2)\).
\[ \mbox{Phi}(x) = \begin{cases} 0 & \mbox{if } x < -37.5 \\ \Phi(x) & \mbox{if } -37.5 \leq x \leq 8.25 \\ 1 & \mbox{if } x > 8.25 \\[6pt] \textrm{error} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{Phi}(x)}{\partial x} = \begin{cases} 0 & \mbox{if } x < -27.5 \\ \frac{\partial\, \Phi(x)}{\partial x} & \mbox{if } -27.5 \leq x \leq 27.5 \\ 0 & \mbox{if } x > 27.5 \\[6pt] \textrm{error} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \Phi(x) = \frac{1}{\sqrt{2\pi}} \int_{0}^{x} e^{-t^2/2} dt \]
\[ \frac{\partial \, \Phi(x)}{\partial x} = \frac{e^{-x^2/2}}{\sqrt{2\pi}} \]
| a | Variable argument. |
|
inline |
|
inline |
|
inline |
Returns the elementwise Phi_approx() of a var_value<matrix_cl<double>>.
| A | argument |
Phi_approx() of the input. Definition at line 20 of file Phi_approx.hpp.
Return an approximation of the unit normal cumulative distribution function (CDF).
| T | scalar type of forward-mode autodiff variable argument. |
| x | argument |
Definition at line 23 of file Phi_approx.hpp.
|
inline |
Return an approximation of the unit normal CDF.
http://www.jiem.org/index.php/jiem/article/download/60/27
This function can be used to implement the inverse link function for probit regression.
| x | Argument. |
Definition at line 23 of file Phi_approx.hpp.
|
inline |
Return an approximation of the unit normal CDF.
| x | argument. |
Definition at line 35 of file Phi_approx.hpp.
Approximation of the unit normal CDF for variables (stan).
http://www.jiem.org/index.php/jiem/article/download/60/27
\[ \mbox{Phi\_approx}(x) = \begin{cases} \Phi_{\mbox{\footnotesize approx}}(x) & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{Phi\_approx}(x)}{\partial x} = \begin{cases} \frac{\partial\, \Phi_{\mbox{\footnotesize approx}}(x)}{\partial x} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \Phi_{\mbox{\footnotesize approx}}(x) = \mbox{logit}^{-1}(0.07056 \, x^3 + 1.5976 \, x) \]
\[ \frac{\partial \, \Phi_{\mbox{\footnotesize approx}}(x)}{\partial x} = -\Phi_{\mbox{\footnotesize approx}}^2(x) e^{-0.07056x^3 - 1.5976x}(-0.21168x^2-1.5976) \]
| a | Variable argument. |
Definition at line 46 of file Phi_approx.hpp.
|
inline |
Definition at line 55 of file Phi_approx.hpp.
|
inline |
Return the elementwise application of Phi_approx() to specified argument container.
The return type promotes the underlying scalar argument type to double if it is an integer, and otherwise is the argument type.
| T | type of container |
| x | container |
Definition at line 69 of file Phi_approx.hpp.
|
static |
|
inline |
| return_type_t<T_theta> stan::math::poisson_binomial_cdf | ( | const T_y & | y, |
| const T_theta & | theta | ||
| ) |
Definition at line 66 of file poisson_binomial_cdf.hpp.
| return_type_t<T_theta> stan::math::poisson_binomial_lccdf | ( | const T_y & | y, |
| const T_theta & | theta | ||
| ) |
Definition at line 77 of file poisson_binomial_lccdf.hpp.
| return_type_t<T_theta> stan::math::poisson_binomial_lcdf | ( | const T_y & | y, |
| const T_theta & | theta | ||
| ) |
Definition at line 67 of file poisson_binomial_lcdf.hpp.
| plain_type_t<T_theta> stan::math::poisson_binomial_log_probs | ( | int | y, |
| const T_theta & | theta | ||
| ) |
Returns the last row of the log probability matrix of the Poisson-Binomial distribution given the number of successes and a vector of success probabilities.
| T_theta | template expression |
| y | numbers of successes |
| theta | N-dimensional vector of success probabilities for each trial |
Definition at line 26 of file poisson_binomial_log_probs.hpp.
| auto stan::math::poisson_binomial_log_probs | ( | const T_y & | y, |
| const T_theta & | theta | ||
| ) |
Definition at line 56 of file poisson_binomial_log_probs.hpp.
| return_type_t<T_theta> stan::math::poisson_binomial_lpmf | ( | const T_y & | y, |
| const T_theta & | theta | ||
| ) |
Definition at line 60 of file poisson_binomial_lpmf.hpp.
| return_type_t<T_rate> stan::math::poisson_cdf | ( | const T_n & | n, |
| const T_rate & | lambda | ||
| ) |
Definition at line 27 of file poisson_cdf.hpp.
| return_type_t<T_rate> stan::math::poisson_lccdf | ( | const T_n & | n, |
| const T_rate & | lambda | ||
| ) |
Definition at line 28 of file poisson_lccdf.hpp.
| return_type_t<T_rate> stan::math::poisson_lcdf | ( | const T_n & | n, |
| const T_rate & | lambda | ||
| ) |
Definition at line 28 of file poisson_lcdf.hpp.
|
inline |
Definition at line 166 of file poisson_log_glm_lpmf.hpp.
| return_type_t<T_log_rate> stan::math::poisson_log_lpmf | ( | const T_n & | n, |
| const T_log_rate & | alpha | ||
| ) |
Definition at line 29 of file poisson_log_lpmf.hpp.
|
inline |
Definition at line 90 of file poisson_log_lpmf.hpp.
| return_type_t<T_rate> stan::math::poisson_lpmf | ( | const T_n & | n, |
| const T_rate & | lambda | ||
| ) |
Definition at line 29 of file poisson_lpmf.hpp.
|
inline |
Definition at line 85 of file poisson_lpmf.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the positive value for the specified unconstrained input.
The transform applied is
\(f(x) = \exp(x)\).
| x | Arbitrary input scalar or container. |
Definition at line 23 of file positive_constrain.hpp.
|
inline |
Return the positive value for the specified unconstrained input, incrementing the scalar reference with the log absolute Jacobian determinant.
See positive_constrain(T) for details of the transform. The log absolute Jacobian determinant is
\(\log | \frac{d}{dx} \mbox{exp}(x) | = \log | \mbox{exp}(x) | = x\).
| T | type of unconstrained value |
| x | unconstrained value or container |
| lp | log density reference. |
Definition at line 44 of file positive_constrain.hpp.
|
inline |
Return the positive value for the specified unconstrained input.
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| x | unconstrained value or container | |
| [in,out] | lp | log density accumulator |
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A standard vector with inner type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| x | unconstrained value or container | |
| [in,out] | lp | log density accumulator |
Definition at line 65 of file positive_constrain.hpp.
|
inline |
Return the unconstrained value corresponding to the specified positive-constrained value.
The transform is the inverse of the transform \(f\) applied by positive_constrain(T), namely
\(f^{-1}(x) = \log(x)\).
The input is validated using check_positive().
| y | Input scalar. |
| T | Type of scalar. |
| std::domain_error | if the variable is negative |
Definition at line 29 of file positive_free.hpp.
|
inlinestatic |
|
inline |
Return an increasing positive ordered vector derived from the specified free vector.
The returned constrained vector will have the same dimensionality as the specified free vector.
| T | type of elements in the vector |
| x | Free vector of scalars. |
Definition at line 24 of file positive_ordered_constrain.hpp.
|
inline |
Return an increasing positive ordered vector derived from the specified free vector.
The returned constrained vector will have the same dimensionality as the specified free vector.
| x | Free vector of scalars |
Definition at line 25 of file positive_ordered_constrain.hpp.
|
inline |
Return a positive valued, increasing positive ordered vector derived from the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.
The returned constrained vector will have the same dimensionality as the specified free vector.
| T | type of elements in the vector |
| x | Free vector of scalars. |
| lp | Log probability reference. |
Definition at line 52 of file positive_ordered_constrain.hpp.
|
inline |
Return a positive valued, increasing positive ordered vector derived from the specified free vector.
The returned constrained vector will have the same dimensionality as the specified free vector. If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| Vec | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase |
| x | Free vector of scalars | |
| [in,out] | lp | log density accumulato |
Definition at line 76 of file positive_ordered_constrain.hpp.
|
inline |
Return a positive valued, increasing positive ordered vector derived from the specified free vector.
The returned constrained vector will have the same dimensionality as the specified free vector. If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| Vec | A standard vector with inner type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase |
| x | Free vector of scalars | |
| [in,out] | lp | log density accumulato |
Definition at line 103 of file positive_ordered_constrain.hpp.
| auto stan::math::positive_ordered_free | ( | const EigVec & | y | ) |
Return the vector of unconstrained scalars that transform to the specified positive ordered vector.
This function inverts the constraining operation defined in positive_ordered_constrain(Matrix),
| T | type of elements in the vector |
| y | Vector of positive, ordered scalars. |
| std::domain_error | if y is not a vector of positive, ordered scalars. |
Definition at line 28 of file positive_ordered_free.hpp.
| auto stan::math::positive_ordered_free | ( | const T & | x | ) |
Overload of positive_ordered_free() to untransform each Eigen vector in a standard vector.
| T | A standard vector with with a value_type which inherits from Eigen::MatrixBase with compile time rows or columns equal to 1. |
| x | The standard vector to untransform. |
Definition at line 52 of file positive_ordered_free.hpp.
|
inline |
Return the first argument raised to the power of the second argument.
| T_a | type of first expression of the base |
| T_b | type of second expression of the exponent |
| a | first expression of base |
| b | second expression of exponent |
|
inline |
Return the base raised to the power of the exponent (cmath).
The partial derivatives are
\(\frac{\partial}{\partial x} \mbox{pow}(x, y) = y x^{y-1}\), and
\(\frac{\partial}{\partial y} \mbox{pow}(x, y) = x^y \ \log x\).
\[ \mbox{pow}(x, y) = \begin{cases} x^y & \mbox{if } -\infty\leq x, y \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{pow}(x, y)}{\partial x} = \begin{cases} yx^{y-1} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{pow}(x, y)}{\partial y} = \begin{cases} x^y\ln x & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } y = \textrm{NaN} \end{cases} \]
| base | Base variable. |
| exponent | Exponent variable. |
|
inline |
Return the base variable raised to the power of the exponent scalar (cmath).
The derivative for the variable is
\(\frac{d}{dx} \mbox{pow}(x, c) = c x^{c-1}\).
The template parameters are coded as they are so that arithmetic types will not be promoted into the var slots.
| T | arithmetic type |
| base | Base variable. |
| exponent | Exponent scalar. |
|
inline |
Return the base scalar raised to the power of the exponent variable (cmath).
The derivative for the variable is
\(\frac{d}{d y} \mbox{pow}(c, y) = c^y \log c \).
The template parameters are coded as they are so that arithmetic types will not be promoted into the var slots.
| T | arithmetic type |
| base | Base scalar. |
| exponent | Exponent variable. |
|
inline |
Return the first argument raised to the power of the second argument.
Note: this overload is required because gcc still provides the C++99 template function pow(complex<T>, int), which introduces an ambiguity.
| T | autodiff value type |
| x | first argument |
| y | second argument |
Return the first argument raised to the power of the second argument.
Note: this overload is required because gcc still provides the C++99 template function pow(complex<T>, int), which introduces an ambiguity.
| x | first argument |
| y | second argument |
|
inline |
This function returns a var for an expression that has the specified value, vector of operands, and vector of partial derivatives of value with respect to the operands.
| Arith | An arithmetic type |
| VecVar | A vector of vars |
| VecArith | A vector of arithmetic types |
| ContainerOperands | tuple of any container operands (var_value containing Eigen types) |
| ContainerGradients | tupleof any container gradients (Eigen types) |
| [in] | value | The value of the resulting dependent variable. |
| [in] | operands | operands. |
| [in] | gradients | vector of partial derivatives of result with respect to operands. |
| container_operands | any container operands | |
| container_gradients | any container gradients |
Definition at line 213 of file precomputed_gradients.hpp.
|
inline |
Return the primitive double value for the specified autodiff variable.
| v | input variable. |
Definition at line 18 of file primitive_value.hpp.
|
inline |
Return the primitive value of the specified forward-mode autodiff variable.
This function applies recursively to higher-order autodiff types to return a primitive double value.
| T | inner type of the fvar |
| v | input variable. |
Definition at line 21 of file primitive_value.hpp.
|
inline |
Return the value of the specified arithmetic argument unmodified with its own declared type.
This template function can only be instantiated with arithmetic types as defined by std library's is_arithmetic trait metaprogram.
This function differs from value_of in that it does not cast all return types to double.
| T | type of arithmetic input. |
| x | input. |
Definition at line 28 of file primitive_value.hpp.
|
inline |
Return the primitive value of the specified argument.
This implementation only applies to non-arithmetic types as defined by std library's is_arithmetic trait metaprogram.
| T | type of non-arithmetic input. |
| x | input. |
Definition at line 44 of file primitive_value.hpp.
|
inline |
Helper function to return the matrix size as either "dynamic" or "1".
| N | Eigen matrix size specification |
| o | output stream |
Definition at line 22 of file assign.hpp.
|
inline |
Prints the autodiff variable stack.
This function is used for debugging purposes.
Only works if all members of stack are vari* as it casts to vari*.
| o | ostream to modify |
Definition at line 20 of file print_stack.hpp.
|
inline |
Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar.
The transform is the inverse logit,
\(f(x) = \mbox{logit}^{-1}(x) = \frac{1}{1 + \exp(x)}\).
| T | type of scalar |
| [in] | x | unconstrained value |
Definition at line 26 of file prob_constrain.hpp.
|
inline |
Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.
The transform is as defined for prob_constrain(T). The log absolute Jacobian determinant is
The log absolute Jacobian determinant is
\(\log | \frac{d}{dx} \mbox{logit}^{-1}(x) |\)
\(\log ((\mbox{logit}^{-1}(x)) (1 - \mbox{logit}^{-1}(x))\)
\(\log (\mbox{logit}^{-1}(x)) + \log (1 - \mbox{logit}^{-1}(x))\).
| T | type of scalar |
| [in] | x | unconstrained value |
| [in,out] | lp | log density |
Definition at line 51 of file prob_constrain.hpp.
|
inline |
Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar.
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | type of scalar |
| [in] | x | unconstrained value |
| [in,out] | lp | log density accumulator |
Definition at line 73 of file prob_constrain.hpp.
|
inline |
Return the free scalar that when transformed to a probability produces the specified scalar.
The function that reverses the constraining transform specified in prob_constrain(T) is the logit function,
\(f^{-1}(y) = \mbox{logit}(y) = \frac{1 - y}{y}\).
| T | type of constrained value |
| y | constrained value |
| std::domain_error | if y is not in (0, 1) |
Definition at line 27 of file prob_free.hpp.
| T stan::math::prod | ( | const T & | v | ) |
| value_type_t<T> stan::math::prod | ( | const T & | m | ) |
|
inline |
|
inline |
| promote_scalar_type<T, S>::type stan::math::promote_scalar | ( | const S & | x | ) |
This is the top-level function to call to promote the scalar types of an input of type S to type T.
| T | scalar type of output. |
| S | input type. |
| x | input vector. |
Definition at line 63 of file promote_scalar.hpp.
| Eigen::Matrix<T, -1, -1> stan::math::pseudo_eigenvalues | ( | const Eigen::Matrix< T,-1,-1 > & | m | ) |
Definition at line 11 of file pseudo_eigenvalues.hpp.
| Eigen::Matrix<T, -1, -1> stan::math::pseudo_eigenvectors | ( | const Eigen::Matrix< T,-1,-1 > & | m | ) |
Definition at line 11 of file pseudo_eigenvectors.hpp.
| void stan::math::qr_decomposition_cl | ( | const matrix_cl< double > & | A, |
| matrix_cl< double > & | Q, | ||
| matrix_cl< double > & | R, | ||
| int | r = 100 |
||
| ) |
Calculates QR decomposition of A using the block Householder algorithm.
The implementation is based on the article: need_Q whether Q needs to be calculated (default true) A matrix to factorize Q out the orthonormal matrix R out the lower triangular matrix r Block size. Optimal value depends on the hardware.
Definition at line 34 of file qr_decomposition.hpp.
|
inline |
| Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, Eigen::Dynamic> stan::math::qr_Q | ( | const EigMat & | m | ) |
| Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, Eigen::Dynamic> stan::math::qr_R | ( | const EigMat & | m | ) |
|
inline |
| Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, Eigen::Dynamic> stan::math::qr_thin_Q | ( | const EigMat & | m | ) |
Returns the orthogonal factor of the thin QR decomposition.
| EigMat | type of the matrix |
| m | Matrix. |
Definition at line 19 of file qr_thin_Q.hpp.
|
inline |
Returns the orthogonal factor of the fat QR decomposition.
| T_m | type of the matrix |
| m | Matrix. |
Definition at line 20 of file qr_thin_Q.hpp.
| Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, Eigen::Dynamic> stan::math::qr_thin_R | ( | const EigMat & | m | ) |
Returns the upper triangular factor of the thin QR decomposition.
| EigMat | type of the matrix |
| m | Matrix. |
Definition at line 19 of file qr_thin_R.hpp.
|
inline |
Returns the orthogonal factor of the thin QR decomposition.
| T_m | type of the matrix |
| m | Matrix. |
Definition at line 20 of file qr_thin_R.hpp.
|
inline |
Return the quadratic form \( B^T A B \).
Symmetry of the resulting matrix is not guaranteed due to numerical precision.
| EigMat1 | type of the first (square) matrix |
| EigMat2 | type of the second matrix |
| A | square matrix |
| B | second matrix |
| std::invalid_argument | if A is not square, or if A cannot be multiplied by B |
Definition at line 31 of file quad_form.hpp.
|
inline |
Return the quadratic form \( B^T A B \).
Symmetry of the resulting matrix is not guaranteed due to numerical precision.
| EigMat1 | type of the first (square) matrix |
| EigMat2 | type of the second matrix |
| A | square matrix |
| B | second matrix |
| std::invalid_argument | if A is not square, or if A cannot be multiplied by B |
Definition at line 31 of file quad_form.hpp.
|
inline |
Return the quadratic form \( B^T A B \).
| EigMat | type of the matrix |
| ColVec | type of the vector |
| A | square matrix |
| B | vector |
| std::invalid_argument | if A is not square, or if A cannot be multiplied by B |
Definition at line 54 of file quad_form.hpp.
|
inline |
Return the quadratic form \( B^T A B \).
| EigMat | type of the matrix |
| ColVec | type of the vector |
| A | square matrix |
| B | vector |
| std::invalid_argument | if A is not square, or if A cannot be multiplied by B |
Definition at line 55 of file quad_form.hpp.
|
inline |
Return the quadratic form \( B^T A B \).
Symmetry of the resulting matrix is not guaranteed due to numerical precision.
| EigMat1 | type of the first (square) matrix |
| EigMat2 | type of the second matrix |
| A | square matrix |
| B | second matrix |
| symmetric | indicates whether the output should be made symmetric |
| std::invalid_argument | if A is not square, or if A cannot be multiplied by B |
Definition at line 244 of file quad_form.hpp.
|
inline |
Return the quadratic form \( B^T A B \).
| EigMat | type of the matrix |
| ColVec | type of the vector |
| A | square matrix |
| B | vector |
| symmetric | indicates whether the output should be made symmetric |
| std::invalid_argument | if A is not square, or if A cannot be multiplied by B |
Definition at line 274 of file quad_form.hpp.
|
inline |
Return the quadratic form \( B^T A B \).
Symmetry of the resulting matrix is not guaranteed due to numerical precision.
This overload handles arguments where one of Mat1 or Mat2 are var_value<T> where T is an Eigen type. The other type can also be a var_value or it can be a matrix type that inherits from EigenBase
| Mat1 | type of the first (square) matrix |
| Mat2 | type of the second matrix |
| A | square matrix |
| B | second matrix |
| symmetric | indicates whether the output should be made symmetric |
| std::invalid_argument | if A is not square, or if A cannot be multiplied by B |
Definition at line 311 of file quad_form.hpp.
|
inline |
Return the quadratic form \( B^T A B \).
This overload handles arguments where one of Mat or Vec are var_value<T> where T is an Eigen type. The other type can also be a var_value, or it can be a type that inherits from EigenBase
| Mat | type of the matrix |
| Vec | type of the vector |
| A | square matrix |
| B | vector |
| symmetric | indicates whether the output should be made symmetric |
| std::invalid_argument | if A is not square, or if A cannot be multiplied by B |
Definition at line 336 of file quad_form.hpp.
|
inline |
Definition at line 13 of file quad_form_diag.hpp.
|
inline |
Return the quadratic form \( B^T A B \) of a symmetric matrix.
Symmetry of the resulting matrix is guaranteed.
| EigMat1 | type of the first (symmetric) matrix |
| EigMat2 | type of the second matrix |
| A | symmetric matrix |
| B | second matrix |
| std::invalid_argument | if A is not symmetric, or if A cannot be multiplied by B |
Definition at line 30 of file quad_form_sym.hpp.
|
inline |
Return the quadratic form \( B^T A B \) of a symmetric matrix.
Symmetry of the resulting matrix is guaranteed.
| EigMat1 | type of the first (symmetric) matrix |
| EigMat2 | type of the second matrix |
| A | symmetric matrix |
| B | second matrix |
| std::invalid_argument | if A is not symmetric, or if A cannot be multiplied by B |
Definition at line 30 of file quad_form_sym.hpp.
|
inline |
Return the quadratic form \( B^T A B \) of a symmetric matrix.
Symmetry of the resulting matrix is guaranteed.
| EigMat1 | type of the first (symmetric) matrix |
| EigMat2 | type of the second matrix |
| A | symmetric matrix |
| B | second matrix |
B is a column vector returns a scalar. | std::invalid_argument | if A is not symmetric, or if A cannot be multiplied by B |
Definition at line 33 of file quad_form_sym.hpp.
|
inline |
Return the quadratic form \( B^T A B \) of a symmetric matrix.
| EigMat | type of the (symmetric) matrix |
| ColVec | type of the vector |
| A | symmetric matrix |
| B | vector |
| std::invalid_argument | if A is not symmetric, or if A cannot be multiplied by B |
Definition at line 56 of file quad_form_sym.hpp.
|
inline |
Return the quadratic form \( B^T A B \) of a symmetric matrix.
| EigMat | type of the (symmetric) matrix |
| ColVec | type of the vector |
| A | symmetric matrix |
| B | vector |
| std::invalid_argument | if A is not symmetric, or if A cannot be multiplied by B |
Definition at line 56 of file quad_form_sym.hpp.
|
inline |
Return sample quantiles corresponding to the given probabilities.
The smallest observation corresponds to a probability of 0 and the largest to a probability of 1.
Implements algorithm 7 from Hyndman, R. J. and Fan, Y., Sample quantiles in Statistical Packages (R's default quantile function)
| T | An Eigen type with either fixed rows or columns at compile time, or std::vector<double> |
| samples_vec | Numeric vector whose sample quantiles are wanted |
| p | Probability with value between 0 and 1. |
| std::invalid_argument | If any element of samples_vec is NaN, or size 0. |
| std::domain_error | If p<0 or p>1. |
Definition at line 32 of file quantile.hpp.
|
inline |
Return sample quantiles corresponding to the given probabilities.
The smallest observation corresponds to a probability of 0 and the largest to a probability of 1.
Implements algorithm 7 from Hyndman, R. J. and Fan, Y., Sample quantiles in Statistical Packages (R's default quantile function)
| T | An Eigen type with either fixed rows or columns at compile time, or std::vector<double> |
| Tp | Type of probabilities vector |
| samples_vec | Numeric vector whose sample quantiles are wanted |
| ps | Vector of probability with value between 0 and 1. |
| std::invalid_argument | If any of the values are NaN or size 0. |
| std::domain_error | If p<0 or p>1 for any p in ps. |
Definition at line 81 of file quantile.hpp.
|
inline |
| int stan::math::rank | ( | const T & | v, |
| int | s | ||
| ) |
| return_type_t<T_y, T_scale> stan::math::rayleigh_cdf | ( | const T_y & | y, |
| const T_scale & | sigma | ||
| ) |
Definition at line 25 of file rayleigh_cdf.hpp.
| return_type_t<T_y, T_scale> stan::math::rayleigh_lccdf | ( | const T_y & | y, |
| const T_scale & | sigma | ||
| ) |
Definition at line 23 of file rayleigh_lccdf.hpp.
| return_type_t<T_y, T_scale> stan::math::rayleigh_lcdf | ( | const T_y & | y, |
| const T_scale & | sigma | ||
| ) |
Definition at line 25 of file rayleigh_lcdf.hpp.
| return_type_t<T_y, T_scale> stan::math::rayleigh_lpdf | ( | const T_y & | y, |
| const T_scale & | sigma | ||
| ) |
Definition at line 25 of file rayleigh_lpdf.hpp.
|
inline |
Definition at line 82 of file rayleigh_lpdf.hpp.
| auto stan::math::read_corr_L | ( | const T & | CPCs, |
| size_t | K | ||
| ) |
Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations.
It is generally better to work with the Cholesky factor rather than the correlation matrix itself when the determinant, inverse, etc. of the correlation matrix is needed for some statistical calculation.
See read_corr_matrix(Array, size_t, T) for more information.
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| CPCs | The (K choose 2) canonical partial correlations in (-1, 1). |
| K | Dimensionality of correlation matrix. |
Definition at line 36 of file read_corr_L.hpp.
| Eigen::Matrix<value_type_t<T>, Eigen::Dynamic, Eigen::Dynamic> stan::math::read_corr_L | ( | const T & | CPCs, |
| size_t | K | ||
| ) |
Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations.
It is generally better to work with the Cholesky factor rather than the correlation matrix itself when the determinant, inverse, etc. of the correlation matrix is needed for some statistical calculation.
See read_corr_matrix(Array, size_t, T) for more information.
| T | type of the array (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1) |
| CPCs | The (K choose 2) canonical partial correlations in (-1, 1). |
| K | Dimensionality of correlation matrix. |
Definition at line 37 of file read_corr_L.hpp.
| Eigen::Matrix<value_type_t<T>, Eigen::Dynamic, Eigen::Dynamic> stan::math::read_corr_L | ( | const T & | CPCs, |
| size_t | K, | ||
| value_type_t< T > & | log_prob | ||
| ) |
Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation.
The implementation is Ben Goodrich's Cholesky factor-based approach to the C-vine method of:
| T | type of the array (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1) |
| CPCs | The (K choose 2) canonical partial correlations in (-1, 1). |
| K | Dimensionality of correlation matrix. |
| log_prob | Reference to variable to increment with the log Jacobian determinant. |
Definition at line 101 of file read_corr_L.hpp.
| auto stan::math::read_corr_L | ( | const T1 & | CPCs, |
| size_t | K, | ||
| T2 & | log_prob | ||
| ) |
Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation.
The implementation is Ben Goodrich's Cholesky factor-based approach to the C-vine method of:
| T | type of input vector (must be a var_value<S> where S inherits from EigenBase) |
| CPCs | The (K choose 2) canonical partial correlations in (-1, 1). |
| K | Dimensionality of correlation matrix. |
| log_prob | Reference to variable to increment with the log Jacobian determinant. |
Definition at line 135 of file read_corr_L.hpp.
| Eigen::Matrix<value_type_t<T_CPCs>, Eigen::Dynamic, Eigen::Dynamic> stan::math::read_corr_matrix | ( | const T_CPCs & | CPCs, |
| size_t | K | ||
| ) |
Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations.
See read_corr_matrix(Array, size_t, T) for more information.
| T_CPCs | type of the array (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1) |
| CPCs | The (K choose 2) canonical partial correlations in (-1, 1). |
| K | Dimensionality of correlation matrix. |
Definition at line 27 of file read_corr_matrix.hpp.
|
inline |
Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations.
See read_corr_matrix(Array, size_t, T) for more information.
| T_CPCs | type of input vector (must be a var_value<T> where T inherits from EigenBase) |
| CPCs | The (K choose 2) canonical partial correlations in (-1, 1). |
| K | Dimensionality of correlation matrix. |
Definition at line 27 of file read_corr_matrix.hpp.
|
inline |
Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation.
It is usually preferable to utilize the version that returns the Cholesky factor of the correlation matrix rather than the correlation matrix itself in statistical calculations.
| T_CPCs | type of input vector (must be a var_value<T> where T inherits from EigenBase) |
| CPCs | The (K choose 2) canonical partial correlations in (-1, 1). |
| K | Dimensionality of correlation matrix. |
| log_prob | Reference to variable to increment with the log Jacobian determinant. |
Definition at line 56 of file read_corr_matrix.hpp.
| Eigen::Matrix<value_type_t<T_CPCs>, Eigen::Dynamic, Eigen::Dynamic> stan::math::read_corr_matrix | ( | const T_CPCs & | CPCs, |
| size_t | K, | ||
| value_type_t< T_CPCs > & | log_prob | ||
| ) |
Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation.
It is usually preferable to utilize the version that returns the Cholesky factor of the correlation matrix rather than the correlation matrix itself in statistical calculations.
| T_CPCs | type of the array (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1) |
| CPCs | The (K choose 2) canonical partial correlations in (-1, 1). |
| K | Dimensionality of correlation matrix. |
| log_prob | Reference to variable to increment with the log Jacobian determinant. |
Definition at line 56 of file read_corr_matrix.hpp.
| Eigen::Matrix<value_type_t<T_CPCs>, Eigen::Dynamic, Eigen::Dynamic> stan::math::read_cov_L | ( | const T_CPCs & | CPCs, |
| const T_sds & | sds, | ||
| value_type_t< T_CPCs > & | log_prob | ||
| ) |
This is the function that should be called prior to evaluating the density of any elliptical distribution.
| T_CPCs | type of T_CPCs vector (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1) |
| T_sds | type of sds vector (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1) |
| CPCs | on (-1, 1) |
| sds | on (0, inf) |
| log_prob | the log probability value to increment with the Jacobian |
Definition at line 30 of file read_cov_L.hpp.
|
inline |
This is the function that should be called prior to evaluating the density of any elliptical distribution.
| T_CPCs | type of CPCs vector (must be a var_value<T> where T inherits from EigenBase) |
| T_sds | type of sds vector (must be a var_value<T> where T inherits from EigenBase) |
| CPCs | on (-1, 1) |
| sds | on (0, inf) |
| log_prob | the log probability value to increment with the Jacobian |
Definition at line 32 of file read_cov_L.hpp.
| var_value<Eigen::MatrixXd> stan::math::read_cov_matrix | ( | const T_CPCs & | CPCs, |
| const T_sds & | sds, | ||
| scalar_type_t< T_CPCs > & | log_prob | ||
| ) |
A generally worse alternative to call prior to evaluating the density of an elliptical distribution.
| T_CPCs | type of CPCs vector (must be a var_value<T> where T inherits from EigenBase) |
| T_sds | type of sds vector (must be a var_value<T> where T inherits from EigenBase) |
| CPCs | on (-1, 1) |
| sds | on (0, inf) |
| log_prob | the log probability value to increment with the Jacobian |
Definition at line 29 of file read_cov_matrix.hpp.
| Eigen::Matrix<value_type_t<T_CPCs>, Eigen::Dynamic, Eigen::Dynamic> stan::math::read_cov_matrix | ( | const T_CPCs & | CPCs, |
| const T_sds & | sds, | ||
| value_type_t< T_CPCs > & | log_prob | ||
| ) |
A generally worse alternative to call prior to evaluating the density of an elliptical distribution.
| T_CPCs | type of T_CPCs vector (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1) |
| T_sds | type of sds vector (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1) |
| CPCs | on (-1, 1) |
| sds | on (0, inf) |
| log_prob | the log probability value to increment with the Jacobian |
Definition at line 29 of file read_cov_matrix.hpp.
|
inline |
Builds a covariance matrix from CPCs and standard deviations.
| T_CPCs | type of CPCs vector (must be a var_value<T> where T inherits from EigenBase) |
| T_sds | type of sds vector (must be a var_value<T> where T inherits from EigenBase) |
| CPCs | in (-1, 1) |
| sds | in (0, inf) |
Definition at line 46 of file read_cov_matrix.hpp.
| Eigen::Matrix<value_type_t<T_CPCs>, Eigen::Dynamic, Eigen::Dynamic> stan::math::read_cov_matrix | ( | const T_CPCs & | CPCs, |
| const T_sds & | sds | ||
| ) |
Builds a covariance matrix from CPCs and standard deviations.
| T_CPCs | type of T_CPCs vector (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1) |
| T_sds | type of sds vector (must be derived from Eigen::ArrayBase and have one compile-time dimension equal to 1) |
| CPCs | in (-1, 1) |
| sds | in (0, inf) |
Definition at line 50 of file read_cov_matrix.hpp.
|
inline |
Function applying the read_fvar_functor to extract the values and tangets of a given fvar matrix into separate matrices.
| EigFvar | type of the Eigen container of fvar. |
| EigOut | type of the Eigen containers to copy to |
| [in] | FvarMat | Input Eigen container of fvar. |
| [in] | ValMat | Output Eigen container of values. |
| [in] | DMat | Output Eigen container of tangents. |
Definition at line 44 of file read_fvar.hpp.
|
inline |
Function applying the val_adj_functor to extract the values and adjoints of a given var or vari matrix into separate matrices.
| EigRev | type of the Eigen container of var or vari. |
| EigDbl | type of the Eigen container of doubles to be copied to. |
| [in] | VarMat | Input Eigen container of var. |
| [in] | ValMat | Output Eigen container of values. |
| [in] | AdjMat | Output Eigen container of adjoints. |
Definition at line 158 of file read_var.hpp.
|
inline |
Function applying the vi_adj_functor to extract the varis and and adjoints of a given var matrix into separate matrices.
| EigVar | type of the Eigen container of var. |
| EigDbl | type of the Eigen container of doubles to be copied to. |
| [in] | VarMat | Input Eigen container of var. |
| [in] | VariMat | Output Eigen container of vari. |
| [in] | AdjMat | Output Eigen container of adjoints. |
Definition at line 193 of file read_var.hpp.
|
inline |
Function applying the vi_val_functor to extract the varis and and values of a given var matrix into separate matrices.
| EigVar | type of the Eigen container of var. |
| EigDbl | type of the Eigen container of doubles to be copied to. |
| [in] | VarMat | Input Eigen container of var. |
| [in] | VariMat | Output Eigen container of vari. |
| [in] | ValMat | Output Eigen container of values. |
Definition at line 175 of file read_var.hpp.
|
inline |
Function applying the vi_val_adj_functor to extract the vari*, values, and adjoints of a given var matrix into separate matrices.
| EigVar | type of the Eigen container of var. |
| EigVari | type of the Eigen container of vari to be copied to. |
| EigDbl | type of the Eigen container of doubles to be copied to. |
| [in] | VarMat | Input Eigen container of var. |
| [in] | VariMat | Output Eigen container of vari. |
| [in] | ValMat | Output Eigen container of values. |
| [in] | AdjMat | Output Eigen container of tangents. |
Definition at line 139 of file read_var.hpp.
| T stan::math::real | ( | const std::complex< T > & | z | ) |
|
inlinestatic |
Recover memory used for all variables for reuse.
| std::logic_error | if empty_nested() returns false |
Definition at line 18 of file recover_memory.hpp.
|
inlinestatic |
Recover only the memory used for the top nested call.
If there is nothing on the nested stack, then a std::logic_error exception is thrown.
It is preferred to use the nested_rev_autodiff class for nested autodiff as it handles recovery of memory automatically.
| std::logic_error | if empty_nested() returns true |
Definition at line 23 of file recover_memory_nested.hpp.
|
inline |
Call an instance of the function ReduceFunction on every element of an input sequence and sum these terms.
This defers to reduce_sum_impl for the appropriate implementation
ReduceFunction must define an operator() with the same signature as: T f(Vec&& vmapped_subset, int start, int end, std::ostream* msgs, Args&&... args)
ReduceFunction must be default constructible without any arguments
grainsize must be greater than or equal to 1
| ReduceFunction | Type of reducer function |
| ReturnType | An arithmetic type |
| Vec | Type of sliced argument |
| Args | Types of shared arguments |
| vmapped | Vector containing one element per term of sum | |
| grainsize | Suggested grainsize for tbb | |
| [in,out] | msgs | The print stream for warning messages |
| args | Shared arguments used in every sum term |
Definition at line 199 of file reduce_sum.hpp.
| auto stan::math::reduce_sum_static | ( | Vec && | vmapped, |
| int | grainsize, | ||
| std::ostream * | msgs, | ||
| Args &&... | args | ||
| ) |
Call an instance of the function ReduceFunction on every element of an input sequence and sum these terms.
This defers to reduce_sum_impl for the appropriate implementation
ReduceFunction must define an operator() with the same signature as: T f(Vec&& vmapped_subset, int start, int end, std::ostream* msgs, Args&&... args)
ReduceFunction must be default constructible without any arguments
grainsize must be greater than or equal to 1
If STAN_THREADS is not defined, do all the work with one ReduceFunction call.
| ReduceFunction | Type of reducer function |
| ReturnType | An arithmetic type |
| Vec | Type of sliced argument |
| Args | Types of shared arguments |
| vmapped | Sliced arguments used only in some sum terms | |
| grainsize | Suggested grainsize for tbb | |
| [in,out] | msgs | The print stream for warning messages |
| args | Shared arguments used in every sum term |
Definition at line 45 of file reduce_sum_static.hpp.
|
inline |
Definition at line 12 of file rep_array.hpp.
|
inline |
Definition at line 18 of file rep_array.hpp.
|
inline |
Definition at line 23 of file rep_array.hpp.
|
inline |
Definition at line 33 of file rep_array.hpp.
|
inline |
Implementation of rep_matrix returning an Eigen matrix with scalar type equal to the input scalar type.
Impl of rep_matrix returning an var_value<Eigen::Matrix> with a var scalar type.
| Ret | An Eigen type. |
| T | A Scalar type. |
| x | A Scalar whose values are propogated to all values in the return matrix. |
| m | Number or rows. |
| n | Number of columns. |
| x | A Scalar whose values are propogated to all values in the return matrix. |
| m | Number or rows. |
| n | Number of columns. |
Definition at line 24 of file rep_matrix.hpp.
|
inline |
Default Implementation of rep_matrix returning an Eigen matrix with scalar type equal to the input scalar type.
| T | A Scalar type. |
| x | A Scalar whose values are propogated to all values in the return matrix. |
| m | Number or rows. |
| n | Number of columns. |
Definition at line 40 of file rep_matrix.hpp.
|
inline |
Implementation of rep_matrix returning an Eigen matrix from an Eigen vector.
Impl of rep_matrix returning a var_value<Eigen::Matrix> from a var_value with an inner Eigen vector type.
| Vec | An Eigen vector. |
| x | An Eigen vector. For Row vectors the values are replacated rowwise. and for column vectors the values are repliacated colwise. |
| n | Number of rows or columns. |
| Ret | A var_value with inner Eigen dynamic matrix type. |
| Vec | A var_value with an inner Eigen vector type. |
| x | A var_value with inner Eigen vector type. For Row vectors the values are replacated rowwise and for column vectors the values are repliacated colwise. |
| n | Number of rows or columns. |
Definition at line 54 of file rep_matrix.hpp.
|
inline |
Definition at line 13 of file rep_row_vector.hpp.
|
inline |
Definition at line 18 of file rep_row_vector.hpp.
|
inline |
Overload for var_value<Vector>.
| T_ret | The user supplied return type. |
| T | A double or var type |
| x | The type to be propogated through the new vector. |
| n | The size of the new vector. |
Definition at line 22 of file rep_row_vector.hpp.
|
inline |
Definition at line 13 of file rep_vector.hpp.
|
inline |
Definition at line 18 of file rep_vector.hpp.
|
inline |
Overload for var_value<Vector>.
| T_ret | The user supplied return type. |
| T | A double or var type |
| x | The type to be propogated through the new vector. |
| n | The size of the new vector. |
Definition at line 22 of file rep_vector.hpp.
|
inline |
Recursively resize the specified vector of vectors, which must bottom out at scalar values, Eigen vectors or Eigen matrices.
| T | type of object being resized |
| x | Array-like object to resize. |
| dims | New dimensions. |
Definition at line 43 of file resize.hpp.
|
inline |
Return a copy of the specified array in reversed order.
| T | type of elements in the array |
| x | array to reverse |
Definition at line 20 of file reverse.hpp.
|
inline |
Return reversed view into the specified vector or row vector.
| T | type of expression |
| x | vector or row vector to reverse |
Definition at line 20 of file reverse.hpp.
|
inline |
Return reversed view into the specified vector or row vector.
| T | type of expression |
| m | vector or row vector to reverse |
Definition at line 23 of file reverse.hpp.
|
inline |
Return a copy of the specified vector or row vector in reversed order.
| T | type of container (vector or row vector) |
| x | vector or row vector to reverse |
Definition at line 35 of file reverse.hpp.
|
inline |
Puts a callback on the autodiff stack to be called in reverse pass.
The intended use case is for the callable to ba a lambda function that captures any arguments it needs to work with. All captured values must be trivially destructible or they will leak memory! to_AD_stack() function can be used to ensure that.
| F | type of callable |
| functor | funtor or other callable to call in the reverse pass |
Definition at line 38 of file reverse_pass_callback.hpp.
Definition at line 25 of file rising_factorial.hpp.
Return autodiff variable with the gradient and result of the rising factorial function applied to the inputs.
Will throw for NaN x and for negative n, as implemented in primitive function.
| T | inner type of the fvar |
| x | Argument. |
| n | Argument |
Definition at line 26 of file rising_factorial.hpp.
|
inline |
Return the rising factorial function evaluated at the inputs.
| T | type of the first argument |
| x | first argument |
| n | second argument |
| std::domain_error | if x is NaN |
| std::domain_error | if n is negative |
\[ \mbox{rising\_factorial}(x, n) = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ x^{(n)} & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{rising\_factorial}(x, n)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \frac{\partial\, x^{(n)}}{\partial x} & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{rising\_factorial}(x, n)}{\partial n} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \frac{\partial\, x^{(n)}}{\partial n} & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]
\[ x^{(n)}=\frac{\Gamma(x+n)}{\Gamma(x)} \]
\[ \frac{\partial \, x^{(n)}}{\partial x} = x^{(n)}(\Psi(x+n)-\Psi(x)) \]
\[ \frac{\partial \, x^{(n)}}{\partial n} = (x)_n\Psi(x+n) \]
Definition at line 63 of file rising_factorial.hpp.
|
inline |
Enables the vectorised application of the rising_factorial function, when the first and/or second arguments are containers.
| T1 | type of first input |
| T2 | type of second input |
| a | First input |
| b | Second input |
Definition at line 81 of file rising_factorial.hpp.
|
inline |
Returns the rounded form of the specified variable (C99).
The derivative is zero everywhere but numbers half way between whole numbers, so for convenience the derivative is defined to be everywhere zero,
\(\frac{d}{dx} \mbox{round}(x) = 0\).
\[ \mbox{round}(x) = \begin{cases} \lceil x \rceil & \mbox{if } x-\lfloor x\rfloor \geq 0.5 \\ \lfloor x \rfloor & \mbox{if } x-\lfloor x\rfloor < 0.5 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{round}(x)}{\partial x} = \begin{cases} 0 & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Specified variable. |
|
inline |
|
inline |
Return the specified row of the specified matrix, using start-at-1 indexing.
This is equivalent to calling m.row(i - 1) and assigning the resulting template expression to a row vector.
| T | type of the matrix |
| m | Matrix. |
| i | Row index (count from 1). |
| std::out_of_range | if i is out of range. |
|
inline |
|
inline |
Returns the dot product of rows of the specified matrices.
| T_a | type of the first matrix |
| T_b | type of the second matrix |
| a | Matrix of first vectors. |
| b | Matrix of second vectors. |
| std::domain_error | If the matrices are not the same size |
Definition at line 27 of file rows_dot_product.hpp.
|
inline |
Returns the dot product of rows of the specified matrices.
| Mat1 | type of the first matrix (must be derived from Eigen::MatrixBase) |
| Mat2 | type of the second matrix (must be derived from Eigen::MatrixBase) |
| v1 | Matrix of first vectors. |
| v2 | Matrix of second vectors. |
| std::domain_error | If the matrices are not the same size |
Definition at line 28 of file rows_dot_product.hpp.
|
inline |
Returns the dot product of rows of the specified matrices.
| T1 | type of the first matrix |
| T2 | type of the second matrix |
| v1 | Matrix of first vectors. |
| v2 | Matrix of second vectors. |
| std::invalid_argument | If the vectors are not the same size |
Definition at line 30 of file rows_dot_product.hpp.
|
inline |
Returns the dot product of rows of the specified matrices.
| Mat1 | type of the first matrix (must be derived from Eigen::MatrixBase) |
| Mat2 | type of the second matrix (must be derived from Eigen::MatrixBase) |
| v1 | Matrix of first vectors. |
| v2 | Matrix of second vectors. |
| std::domain_error | If the vectors are not the same size or if they are both not vector dimensioned. |
Definition at line 33 of file rows_dot_product.hpp.
|
inline |
Returns the dot product of rows of the specified matrices.
This overload is used when at least one of Mat1 and Mat2 is a var_value<T> where T inherits from EigenBase. The other argument can be another var_value or a type that inherits from EigenBase.
| Mat1 | type of the first matrix |
| Mat2 | type of the second matrix |
| v1 | Matrix of first vectors. |
| v2 | Matrix of second vectors. |
| std::domain_error | If the vectors are not the same size or if they are both not vector dimensioned. |
Definition at line 63 of file rows_dot_product.hpp.
|
inline |
Returns the dot product of each row of a matrix with itself.
| Mat | An Eigen matrix with a var scalar type. |
| x | Matrix. |
Definition at line 20 of file rows_dot_self.hpp.
|
inline |
Returns the dot product of each row of a matrix with itself.
| T | type of the matrix (must be derived from Eigen::MatrixBase) |
| x | matrix |
Definition at line 20 of file rows_dot_self.hpp.
|
inline |
Returns the dot product of each row of a matrix with itself.
| T | type of the matrix |
| v | Matrix. |
Definition at line 22 of file rows_dot_self.hpp.
|
inline |
Returns the dot product of each row of a matrix with itself.
| T_a | type of the matrix |
| a | matrix |
Definition at line 23 of file rows_dot_self.hpp.
|
inline |
Returns the dot product of row row of a matrix with itself.
| Mat | A var_value<> with an inner matrix type. |
| x | Matrix. |
Definition at line 36 of file rows_dot_self.hpp.
|
inline |
Broadcast an expression in rowwise dimmension if the number of columns equals to 1.
In that case further expressions can use this expression as if had any number of columns, repeating the values.
Broadcasting evaluates argument expression multiple times. For performance reasons don't broadcast slow operations. Instead evaluate them in a separate kernel.
| T | type of input expression |
| a | input expression |
Definition at line 222 of file optional_broadcast.hpp.
|
inline |
Save the vari pointer in x into the memory pointed to by dest, increment the dest storage pointer, recursively call save_varis on the rest of the arguments, and return the final value of the dest storage pointer.
| Pargs | Types of remaining arguments |
| [in,out] | dest | Pointer to where vari pointers are saved |
| [in] | x | A var |
| [in] | args | Additional arguments to have their varis saved |
Definition at line 51 of file save_varis.hpp.
|
inline |
Save the vari pointers in x into the memory pointed to by dest, increment the dest storage pointer, recursively call save_varis on the rest of the arguments, and return the final value of the dest storage pointer.
| VarVec | A variant of std::vector<var> |
| Pargs | Types of remaining arguments |
| [in,out] | dest | Pointer to where vari pointers are saved |
| [in] | x | A std::vector of vars |
| [in] | args | Additional arguments to have their varis saved |
Definition at line 71 of file save_varis.hpp.
|
inline |
Save the vari pointers in x into the memory pointed to by dest, increment the dest storage pointer, recursively call save_varis on the rest of the arguments, and return the final value of the dest storage pointer.
| VecContainer | std::vector<T> where T is another type containing vars |
| Pargs | Types of remaining arguments |
| [in,out] | dest | Pointer to where vari pointers are saved |
| [in] | x | A std::vector of containers containing of vars |
| [in] | args | Additional arguments to have their varis saved |
Definition at line 93 of file save_varis.hpp.
|
inline |
Save the vari pointers in x into the memory pointed to by dest, increment the dest storage pointer, recursively call save_varis on the rest of the arguments, and return the final value of the dest storage pointer.
| EigT | An Eigen type with var value type |
| Pargs | Types of remaining arguments |
| [in,out] | dest | Pointer to where vari pointers are saved |
| [in] | x | An Eigen container of vars |
| [in] | args | Additional arguments to have their varis saved |
Definition at line 114 of file save_varis.hpp.
|
inline |
Ignore arithmetic types.
Recursively call save_varis on the rest of the arguments and return the final value of the dest storage pointer.
| Arith | An arithmetic type |
| Pargs | Types of remaining arguments |
| [in,out] | dest | Pointer to where vari pointers are saved |
| [in] | x | An argument not containing vars |
| [in] | args | Additional arguments to have their varis saved |
Definition at line 135 of file save_varis.hpp.
End save_varis recursion and return pointer.
| dest | Pointer |
Definition at line 144 of file save_varis.hpp.
| double stan::math::scalbn | ( | const T & | x, |
| int | n | ||
| ) |
Definition at line 12 of file scalbn.hpp.
|
inline |
Return product of exp(At) and B, where A is a NxN double matrix, B is a NxCb double matrix, and t is a double.
Specialized for double values for efficiency.
| EigMat1 | type of the first matrix |
| EigMat2 | type of the second matrix |
| [in] | A | Matrix |
| [in] | B | Matrix |
| [in] | t | double |
Definition at line 30 of file scale_matrix_exp_multiply.hpp.
|
inline |
Return product of exp(At) and B, where A is a NxN matrix, B is a NxCb matrix and t is a scalar.
Generic implementation when arguments are not all double.
| Tt | type of t |
| EigMat1 | type of the first matrix |
| EigMat2 | type of the second matrix |
| [in] | A | Matrix |
| [in] | B | Matrix |
| [in] | t | double |
Definition at line 60 of file scale_matrix_exp_multiply.hpp.
|
inline |
Definition at line 11 of file scaled_add.hpp.
| return_type_t<T_y, T_dof, T_scale> stan::math::scaled_inv_chi_square_lccdf | ( | const T_y & | y, |
| const T_dof & | nu, | ||
| const T_scale & | s | ||
| ) |
Definition at line 25 of file scaled_inv_chi_square_lccdf.hpp.
| return_type_t<T_y, T_dof, T_scale> stan::math::scaled_inv_chi_square_lcdf | ( | const T_y & | y, |
| const T_dof & | nu, | ||
| const T_scale & | s | ||
| ) |
Definition at line 25 of file scaled_inv_chi_square_lcdf.hpp.
|
inline |
Definition at line 176 of file scaled_inv_chi_square_lpdf.hpp.
|
inline |
| var stan::math::sd | ( | const T & | x | ) |
Return the sample standard deviation of a variable which inherits from EigenBase.
Return the sample standard deviation of the var_value matrix.
| T | Input type |
| [in] | x | input |
| domain | error size is not greater than zero. |
| T | Input type |
| [in] | x | input matrix |
| domain | error size is not greater than zero. |
|
inline |
| auto stan::math::sd | ( | const T & | m | ) |
Return the sample standard deviation of the specified std vector, column vector, row vector, matrix, or std vector of any of these types.
| T | Input type |
| [in] | m | input matrix |
| domain | error size is not greater than zero. |
|
inline |
Return the specified number of elements as a row/column vector starting from the specified element - 1 of the specified row/column vector.
| T | type of the vector |
Definition at line 18 of file segment.hpp.
|
inline |
Return the specified number of elements as a row/column vector starting from the specified element - 1 of the specified row/column vector.
| T_x | type of input kernel generator expression x |
| x | input kernel generator expression. |
| i | Starting row/column + 1. |
| n | Number of rows/columns in segment. |
| std::out_of_range | if either index is out of range. |
Definition at line 24 of file segment.hpp.
| std::vector<T> stan::math::segment | ( | const std::vector< T > & | sv, |
| size_t | i, | ||
| size_t | n | ||
| ) |
Definition at line 30 of file segment.hpp.
|
static |
Reset all adjoint values in the stack to zero.
Definition at line 14 of file set_zero_all_adjoints.hpp.
|
static |
Reset all adjoint values in the top nested portion of the stack to zero.
It is preferred to use the nested_rev_autodiff class for nested autodiff class as it handles recovery of memory automatically.
Definition at line 20 of file set_zero_all_adjoints_nested.hpp.
|
inline |
|
inline |
Returns signs of the arguments.
Return the elementwise application of sign() to specified argument container.
| T | type of the argument (matrix_cl or kernel generator expression) |
| x | the argument |
x| T | type of container |
| x | container |
|
inline |
Return true if the specified argument is negative and false otherwise.
Overloads std::signbit from <cmath> for argument-dependent lookup.
| ADType | type of argument |
| [in] | v | argument |
true if the argument is negative Definition at line 21 of file signbit.hpp.
|
inline |
Return the simplex corresponding to the specified free vector.
A simplex is a vector containing values greater than or equal to 0 that sum to 1. A vector with (K-1) unconstrained values will produce a simplex of size K.
The transform is based on a centered stick-breaking process.
| Vec | type of the vector |
| y | Free vector input of dimensionality K - 1. |
Definition at line 29 of file simplex_constrain.hpp.
|
inline |
Return the simplex corresponding to the specified free vector.
A simplex is a vector containing values greater than or equal to 0 that sum to 1. A vector with (K-1) unconstrained values will produce a simplex of size K.
The transform is based on a centered stick-breaking process.
| T | Type of vector to constrain |
| y | Free vector input of dimensionality K - 1 |
Definition at line 31 of file simplex_constrain.hpp.
|
inline |
Return the simplex corresponding to the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.
The simplex transform is defined through a centered stick-breaking process.
| Vec | type of the vector |
| y | Free vector input of dimensionality K - 1. |
| lp | Log probability reference to increment. |
Definition at line 61 of file simplex_constrain.hpp.
| auto stan::math::simplex_constrain | ( | const T & | y, |
| scalar_type_t< T > & | lp | ||
| ) |
Return the simplex corresponding to the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.
The simplex transform is defined through a centered stick-breaking process.
| T | type of the vector to constrain |
| y | Free vector input of dimensionality N. |
| lp | Log probability reference to increment. |
Definition at line 85 of file simplex_constrain.hpp.
| auto stan::math::simplex_constrain | ( | const Vec & | y, |
| return_type_t< Vec > & | lp | ||
| ) |
Return the simplex corresponding to the specified free vector.
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| Vec | A type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| [in] | y | free vector |
| [in,out] | lp | log density accumulator |
y Definition at line 101 of file simplex_constrain.hpp.
|
inline |
Return the simplex corresponding to the specified free vector.
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| Vec | A standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| [in] | y | free vector |
| [in,out] | lp | log density accumulator |
y Definition at line 126 of file simplex_constrain.hpp.
| auto stan::math::simplex_free | ( | const Vec & | x | ) |
Return an unconstrained vector that when transformed produces the specified simplex.
It applies to a simplex of dimensionality K and produces an unconstrained vector of dimensionality (K-1).
The simplex transform is defined through a centered stick-breaking process.
| ColVec | type of the simplex (must be a column vector) |
| x | Simplex of dimensionality K. |
| std::domain_error | if x is not a valid simplex |
Definition at line 30 of file simplex_free.hpp.
| auto stan::math::simplex_free | ( | const T & | x | ) |
Overload of simplex_free() to untransform each Eigen vector in a standard vector.
| T | A standard vector with with a value_type which inherits from Eigen::MatrixBase with compile time rows or columns equal to 1. |
| x | The standard vector to untransform. |
Definition at line 56 of file simplex_free.hpp.
|
inline |
Return the sine of a radian-scaled variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \sin x = \cos x\).
\[ \mbox{sin}(x) = \begin{cases} \sin(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{sin}(x)}{\partial x} = \begin{cases} \cos(x) & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Variable for radians of angle. |
|
inline |
|
inline |
|
inline |
Return the singular values of the specified matrix.
Adjoint update equation comes from Equation (4) in Differentiable Programming Tensor Networks(H. Liao, J. Liu, et al., arXiv:1903.09650).
| EigMat | type of input matrix |
| m | MxN input matrix |
Definition at line 23 of file singular_values.hpp.
| Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, 1> stan::math::singular_values | ( | const EigMat & | m | ) |
Return the vector of the singular values of the specified matrix in decreasing order of magnitude.
See the documentation for svd() for information on the singular values.
| EigMat | type of the matrix |
| m | Specified matrix. |
Definition at line 23 of file singular_values.hpp.
|
inline |
Return the hyperbolic sine of the specified variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \sinh x = \cosh x\).
\[ \mbox{sinh}(x) = \begin{cases} \sinh(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{sinh}(x)}{\partial x} = \begin{cases} \cosh(x) & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Variable. |
|
inline |
|
inline |
| size_t stan::math::size_mvt | ( | const MatrixT & | ) |
Definition at line 29 of file size_mvt.hpp.
| size_t stan::math::size_mvt | ( | const std::vector< MatrixT > & | x | ) |
Definition at line 34 of file size_mvt.hpp.
|
inline |
Returns 1 if input is of length 0, returns 0 otherwise.
| x | argument |
Definition at line 18 of file size_zero.hpp.
|
inline |
Returns 1 if any inputs are of length 0, returns 0 otherwise.
| x | first argument |
| xs | parameter pack of remaining arguments to forward to function |
Definition at line 31 of file size_zero.hpp.
| return_type_t<T_y, T_loc, T_scale, T_skewness> stan::math::skew_double_exponential_lpdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma, | ||
| const T_skewness & | tau | ||
| ) |
Definition at line 131 of file skew_double_exponential_lpdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::skew_normal_cdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 28 of file skew_normal_cdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::skew_normal_lccdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 26 of file skew_normal_lccdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::skew_normal_lcdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 28 of file skew_normal_lcdf.hpp.
| return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::skew_normal_lpdf | ( | const T_y & | y, |
| const T_loc & | mu, | ||
| const T_scale & | sigma, | ||
| const T_shape & | alpha | ||
| ) |
Definition at line 29 of file skew_normal_lpdf.hpp.
|
inline |
Definition at line 119 of file skew_normal_lpdf.hpp.
|
inline |
Definition at line 16 of file softmax.hpp.
|
inline |
Returns softmax of given argument.
| T | type of the argument |
| A | argument |
Definition at line 23 of file softmax.hpp.
|
inline |
Return the softmax of the specified vector.
| T | type of the vector |
| [in] | a | Vector to transform. |
Definition at line 23 of file softmax.hpp.
|
inline |
Return the softmax of the specified Eigen vector.
Softmax is guaranteed to return a simplex.
| alpha | Unconstrained input vector. |
| std::domain_error | If the input vector is size 0. |
Definition at line 28 of file softmax.hpp.
|
inline |
Return the softmax of the specified vector.
\( \mbox{softmax}(y) = \frac{\exp(y)} {\sum_{k=1}^K \exp(y_k)}, \)
The entries in the Jacobian of the softmax function are given by \( \begin{array}{l} \displaystyle \frac{\partial}{\partial y_m} \mbox{softmax}(y)[k] \\[8pt] \displaystyle \mbox{ } \ \ \ = \left\{ \begin{array}{ll} \mbox{softmax}(y)[k] \times (1 - \mbox{softmax}(y)[m]) & \mbox{ if } m = k, \mbox{ and} \\[6pt] -\mbox{softmax}(y)[k] \times \mbox{softmax}(y)[m] & \mbox{ if } m \neq k. \end{array} \right. \end{array} \)
| ColVec | type of elements in the vector |
| [in] | v | Vector to transform. |
Definition at line 47 of file softmax.hpp.
|
inline |
Sort the (row)vector in ascending order.
| input | vector of row vector to sort |
Definition at line 21 of file sort_asc.hpp.
|
inline |
Return the specified standard vector in ascending order.
| T | Type of elements contained in vector. |
| xs | Vector to order. |
| std::domain_error | If any of the values are NaN. |
Definition at line 22 of file sort_asc.hpp.
|
inline |
Return the specified vector in ascending order.
| EigVec | type of the vector |
| xs | Vector to order. |
| std::domain_error | If any of the values are NaN. |
Definition at line 38 of file sort_asc.hpp.
|
inline |
Sort the (row)vector in ascending order.
| input | vector of row vector to sort |
Definition at line 21 of file sort_desc.hpp.
|
inline |
Return the specified standard vector in descending order.
| T | Type of elements contained in vector. |
| xs | Vector to order. |
| std::domain_error | If any of the values are NaN. |
Definition at line 23 of file sort_desc.hpp.
|
inline |
Return the specified vector in descending order.
| EigVec | type of the vector |
| xs | Vector to order. |
| std::domain_error | If any of the values are NaN. |
Definition at line 39 of file sort_desc.hpp.
| std::vector<int> stan::math::sort_indices | ( | const C & | xs | ) |
Return an integer array of indices of the specified container sorting the values in ascending or descending order based on the value of the first template parameter.
| ascending | true if sort is in ascending order |
| C | type of container |
| xs | Container to sort |
Definition at line 64 of file sort_indices.hpp.
| std::vector<int> stan::math::sort_indices_asc | ( | const C & | xs | ) |
Return a sorted copy of the argument container in ascending order.
| C | type of container |
| xs | Container to sort |
Definition at line 21 of file sort_indices_asc.hpp.
| std::vector<int> stan::math::sort_indices_desc | ( | const C & | xs | ) |
Return a sorted copy of the argument container in ascending order.
| C | type of container |
| xs | Container to sort |
Definition at line 21 of file sort_indices_desc.hpp.
|
inline |
Return the square root of the specified variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \sqrt{x} = \frac{1}{2 \sqrt{x}}\).
\[ \mbox{sqrt}(x) = \begin{cases} \textrm{NaN} & x < 0 \\ \sqrt{x} & \mbox{if } x\geq 0\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{sqrt}(x)}{\partial x} = \begin{cases} \textrm{NaN} & x < 0 \\ \frac{1}{2\sqrt{x}} & x\geq 0\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Variable whose square root is taken. |
|
inline |
|
inline |
|
inlinestatic |
Returns the square root of two.
Definition at line 235 of file constants.hpp.
Definition at line 12 of file square.hpp.
|
inline |
Returns the elementwise square() of a var_value<matrix_cl<double>>.
| A | argument |
square() of the input. Definition at line 20 of file square.hpp.
|
inline |
Return the square of the specified argument.
\(\mbox{square}(x) = x^2\).
The implementation of square(x) is just x * x. Given this, this method is mainly useful in cases where x is not a simple primitive type, particularly when it is an autodiff type.
| x | Input to square. |
Definition at line 26 of file square.hpp.
Return the square of the input variable.
Using square(x) is more efficient than using x * x.
\[ \mbox{square}(x) = \begin{cases} x^2 & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{square}(x)}{\partial x} = \begin{cases} 2x & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| x | Variable to square. |
Definition at line 35 of file square.hpp.
|
inline |
Return the elementwise square of x.
| T | type of x |
| x | argument |
Definition at line 49 of file square.hpp.
|
inline |
Vectorized version of square().
| Container | type of container |
| x | container |
Definition at line 54 of file square.hpp.
|
inline |
Version of square() that accepts std::vectors, Eigen Matrix/Array objects or expressions, and containers of these.
| Container | Type of x |
| x | Container |
Definition at line 68 of file square.hpp.
Returns the squared distance.
Definition at line 21 of file squared_distance.hpp.
|
inline |
Returns the squared distance.
| Scal1 | Type of the first scalar. |
| Scal2 | Type of the second scalar. |
| x1 | First scalar. |
| x2 | Second scalar. |
| std::domain_error | Any scalar is not finite. |
Definition at line 26 of file squared_distance.hpp.
|
inline |
Returns the squared distance.
| T_a | type of the first kernel generator expression |
| T_b | type of the second kernel generator expression |
| a | first kernel generator expression |
| b | second kernel generator expression |
| std::domain_error | If the matrices are not the same size |
Definition at line 30 of file squared_distance.hpp.
|
inline |
Returns the squared distance.
| T_a | type of first expression |
| T_b | type of second expression |
| a | first expression |
| b | second expression |
Definition at line 32 of file squared_distance.hpp.
Returns the squared distance.
Definition at line 35 of file squared_distance.hpp.
Returns the squared distance.
Definition at line 47 of file squared_distance.hpp.
|
inline |
Returns the squared distance between the specified vectors of the same dimensions.
| EigVec1 | type of the first vector (must be derived from Eigen::MatrixBase and have one compile time dimension equal to 1) |
| EigVec2 | type of the second vector (must be derived from Eigen::MatrixBase and have one compile time dimension equal to 1) |
| v1 | First vector. |
| v2 | Second vector. |
| std::domain_error | If the vectors are not the same size. |
Definition at line 50 of file squared_distance.hpp.
|
inline |
Definition at line 119 of file squared_distance.hpp.
|
inline |
Definition at line 127 of file squared_distance.hpp.
|
inline |
Definition at line 135 of file squared_distance.hpp.
|
inline |
Compute the squared distance between the elements in two inputs.
This overload handles arguments where one of T1 or T2 are var_value<T> where T is an Eigen type. The other type can also be a var_value or it can be a matrix type that inherits from EigenBase
| T1 | type of first argument |
| T2 | type of second argument |
| A | first argument |
| B | second argument |
Definition at line 157 of file squared_distance.hpp.
|
inline |
Definition at line 11 of file stan_print.hpp.
| void stan::math::stan_print | ( | std::ostream * | o, |
| const T & | x | ||
| ) |
Definition at line 13 of file stan_print.hpp.
| void stan::math::stan_print | ( | std::ostream * | o, |
| const EigVec & | x | ||
| ) |
Definition at line 18 of file stan_print.hpp.
| void stan::math::stan_print | ( | std::ostream * | o, |
| const EigMat & | x | ||
| ) |
Definition at line 33 of file stan_print.hpp.
| void stan::math::stan_print | ( | std::ostream * | o, |
| const std::vector< T > & | x | ||
| ) |
Definition at line 54 of file stan_print.hpp.
|
inlinestatic |
Record the current position so that recover_memory_nested() can find it.
It is preferred to use the nested_rev_autodiff class for nested autodiff as it handles recovery of memory automatically.
Definition at line 16 of file start_nested.hpp.
| T1 stan::math::static_select | ( | T1 && | a, |
| T2 && | b | ||
| ) |
Returns one of the arguments that can be of different type, depending on the compile time condition.
Can often be used in place of c++17 if constexpr.
| Condition | condition |
| T1 | type of the first argument |
| T2 | type of the second argument |
| a | first argument; returned if the Condition is true |
| b | second argument; returned if the Condition is false |
Condition Definition at line 24 of file static_select.hpp.
| T2 stan::math::static_select | ( | T1 && | a, |
| T2 && | b | ||
| ) |
Definition at line 30 of file static_select.hpp.
|
inline |
Definition at line 24 of file std_normal_lccdf.hpp.
|
inline |
Definition at line 27 of file std_normal_lcdf.hpp.
|
inline |
Definition at line 68 of file std_normal_lpdf.hpp.
Return the step, or heaviside, function applied to the specified variable (stan).
See step() for the double-based version.
The derivative of the step function is zero everywhere but at 0, so for convenience, it is taken to be everywhere zero,
\(\mbox{step}(x) = 0\).
| a | Variable argument. |
|
inline |
The step, or Heaviside, function.
The function is defined by
step(y) = (y < 0.0) ? 0 : 1.
\[ \mbox{step}(x) = \begin{cases} 0 & \mbox{if } x \le 0 \\ 1 & \mbox{if } x \ge 0 \\[6pt] 0 & \mbox{if } x = \textrm{NaN} \end{cases} \]
| T | type of value |
| y | value |
|
inline |
| return_type_t<T_y, T_dof, T_loc, T_scale> stan::math::student_t_cdf | ( | const T_y & | y, |
| const T_dof & | nu, | ||
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 23 of file student_t_cdf.hpp.
| return_type_t<T_y, T_dof, T_loc, T_scale> stan::math::student_t_lccdf | ( | const T_y & | y, |
| const T_dof & | nu, | ||
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 24 of file student_t_lccdf.hpp.
| return_type_t<T_y, T_dof, T_loc, T_scale> stan::math::student_t_lcdf | ( | const T_y & | y, |
| const T_dof & | nu, | ||
| const T_loc & | mu, | ||
| const T_scale & | sigma | ||
| ) |
Definition at line 24 of file student_t_lcdf.hpp.
|
inline |
Definition at line 154 of file student_t_lpdf.hpp.
|
inline |
Return a 1 x ncols subrow starting at (i-1, j-1).
| T_x | type of input kernel generator expression x |
| x | input kernel generator expression. |
| i | Starting row + 1. |
| j | Starting column + 1. |
| nrows | Number of rows in block. |
| std::out_of_range | if either index is out of range. |
Definition at line 23 of file sub_col.hpp.
|
inline |
Return a nrows x 1 subcolumn starting at (i-1, j-1).
| T | type of the matrix |
| m | Matrix. |
| i | Starting row + 1. |
| j | Starting column + 1. |
| nrows | Number of rows in block. |
| std::out_of_range | if either index is out of range. |
Definition at line 23 of file sub_col.hpp.
|
inline |
Return a 1 x ncols subrow starting at (i-1, j-1).
| T_x | type of input kernel generator expression x |
| x | input kernel generator expression. |
| i | Starting row + 1. |
| j | Starting column + 1. |
| ncols | Number of columns in block. |
| std::out_of_range | if either index is out of range. |
Definition at line 23 of file sub_row.hpp.
|
inline |
Return a 1 x ncols subrow starting at (i-1, j-1).
| T | type of the matrix |
| m | Matrix Input matrix. |
| i | Starting row + 1. |
| j | Starting column + 1. |
| ncols | Number of columns in block. |
| std::out_of_range | if either index is out of range. |
Definition at line 23 of file sub_row.hpp.
|
inline |
Return the result of subtracting the second scalar from the first scalar.
| ScalarA | type of the first scalar |
| ScalarB | type of the second scalar |
| a | first scalar |
| b | second scalar |
Definition at line 24 of file subtract.hpp.
|
inline |
Subtraction of two reverse mode matrices and/or kernel generator expressions.
| T_a | type of first expression |
| T_b | type of second expression |
| a | first expression |
| b | second expression |
Definition at line 31 of file subtract.hpp.
|
inline |
Return the result of subtracting the second specified matrix from the first specified matrix.
| Mat1 | type of the first matrix or expression |
| Mat2 | type of the second matrix or expression |
| m1 | First matrix or expression. |
| m2 | Second matrix or expression. |
Definition at line 43 of file subtract.hpp.
|
inline |
Return the result of subtracting the specified matrix from the specified scalar.
| Scal | type of the scalar |
| Mat | type of the matrix or expression |
| c | Scalar. |
| m | Matrix or expression. |
Definition at line 61 of file subtract.hpp.
|
inline |
Return the result of subtracting the specified scalar from the specified matrix.
| Mat | type of the matrix or expression |
| Scal | type of the scalar |
| m | Matrix or expression. |
| c | Scalar. |
Definition at line 78 of file subtract.hpp.
|
inline |
Subtraction operator for matrix variables.
| VarMat1 | A matrix of vars or a var with an underlying matrix type. |
| VarMat2 | A matrix of vars or a var with an underlying matrix type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 118 of file operator_subtraction.hpp.
|
inline |
Subtraction operator for a matrix variable and arithmetic.
| VarMat | A matrix of vars or a var with an underlying matrix type. |
| Arith | A type with an arithmetic Scalar type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 149 of file operator_subtraction.hpp.
|
inline |
Subtraction operator for an arithmetic type and matrix variable.
| VarMat | A matrix of vars or a var with an underlying matrix type. |
| Arith | A type with an arithmetic Scalar type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 175 of file operator_subtraction.hpp.
|
inline |
Subtraction operator for an arithmetic matrix and variable.
| Var | A var_value with an underlying arithmetic type. |
| EigMat | An Eigen Matrix type with an arithmetic Scalar type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 201 of file operator_subtraction.hpp.
|
inline |
Subtraction operator for a variable and arithmetic matrix.
| EigMat | An Eigen Matrix type with an arithmetic Scalar type. |
| Var | A var_value with an underlying arithmetic type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 220 of file operator_subtraction.hpp.
|
inline |
Subtraction operator for a variable and variable matrix.
| VarMat | An Eigen Matrix type with a variable Scalar type or a var_value with an underlying matrix type. |
| Var | A var_value with an underlying arithmetic type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 240 of file operator_subtraction.hpp.
|
inline |
Subtraction operator for a variable matrix and variable.
| VarMat | An Eigen Matrix type with a variable Scalar type or a var_value with an underlying matrix type. |
| Var | A var_value with an underlying arithmetic type. |
| a | First variable operand. |
| b | Second variable operand. |
Definition at line 269 of file operator_subtraction.hpp.
|
inline |
Definition at line 288 of file operator_subtraction.hpp.
|
inline |
Definition at line 294 of file operator_subtraction.hpp.
|
inline |
|
inline |
|
inline |
Return the sum of the entries of the specified matrix.
Returns the sum of the coefficients of the specified Eigen Matrix, Array or expression.
Calculates sum of given kernel generator expression.
| T | type of the matrix |
| m | Matrix. |
| T | type of the expression |
| m | expression to sum |
| T | Type of argument |
| m | argument |
|
inline |
| Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, Eigen::Dynamic> stan::math::svd_U | ( | const EigMat & | m | ) |
|
inline |
Given input matrix m, return matrix U where m = UDV^{T}
Adjoint update equation comes from Equation (4) in Differentiable Programming Tensor Networks(H. Liao, J. Liu, et al., arXiv:1903.09650).
| EigMat | type of input matrix |
| m | MxN input matrix |
| Eigen::Matrix<value_type_t<EigMat>, Eigen::Dynamic, Eigen::Dynamic> stan::math::svd_V | ( | const EigMat & | m | ) |
|
inline |
Given input matrix m, return matrix V where m = UDV^{T}
Adjoint update equation comes from Equation (4) in Differentiable Programming Tensor Networks(H. Liao, J. Liu, et al., arXiv:1903.09650).
| EigMat | type of input matrix |
| m | MxN input matrix |
| void stan::math::symmetric_eigensolver | ( | const matrix_cl< double > & | A, |
| matrix_cl< double > & | eigenvalues, | ||
| matrix_cl< double > & | eigenvectors | ||
| ) |
Definition at line 13 of file symmetric_eigensolver.hpp.
|
inline |
Return a symmetric matrix using elements from the lower triangular part of the input matrix.
| T | type of elements in the matrix |
| m | Matrix. |
| std:invalid_argument | if the matrix is not square. |
Definition at line 20 of file symmetrize_from_lower_tri.hpp.
|
inline |
Return a symmetric matrix using elements from the upper triangular part of the input matrix.
| T_x | type of elements in the matrix |
| x | Matrix. |
| std:invalid_argument | if the matrix is not square. |
Definition at line 21 of file symmetrize_from_lower_tri.hpp.
|
inline |
Return a symmetric matrix using elements from the upper triangular part of the input matrix.
| T_x | type of elements in the matrix |
| A | Matrix. |
| std:invalid_argument | if the matrix is not square. |
Definition at line 22 of file symmetrize_from_lower_tri.hpp.
|
inline |
Return a symmetric matrix using elements from the upper triangular part of the input matrix.
| T | type of elements in the matrix |
| m | Matrix. |
| std:invalid_argument | if the matrix is not square. |
Definition at line 20 of file symmetrize_from_upper_tri.hpp.
|
inline |
Return a symmetric matrix using elements from the lower triangular part of the input matrix.
| T_x | type of the matrix |
| x | Matrix. |
| std:invalid_argument | if the matrix is not square. |
Definition at line 21 of file symmetrize_from_upper_tri.hpp.
|
inline |
Return a symmetric matrix using elements from the upper triangular part of the input matrix.
| T_x | type of elements in the matrix |
| A | Matrix. |
| std:invalid_argument | if the matrix is not square. |
Definition at line 22 of file symmetrize_from_upper_tri.hpp.
|
inline |
Throw a system error with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing system errors. This will allow us to change the behavior for all functions at once. The message is: "<function>: <name> <msg1><y><msg2>"
| [in] | function | Name of the function. |
| [in] | name | Name of the variable. |
| [in] | y | Error code. |
| [in] | msg1 | Message to print before the variable. |
| [in] | msg2 | Message to print after the variable. |
| std::system_error | Always. |
Definition at line 25 of file system_error.hpp.
|
inline |
Throw a system error with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing system errors. This will allow us to change the behavior for all functions at once. The message is: * "<function>: <name> <msg1><y>"
| [in] | function | Name of the function. |
| [in] | name | Name of the variable. |
| [in] | y | Error code. |
| [in] | msg1 | Message to print before the variable. |
| std::system_error | Always. |
Definition at line 45 of file system_error.hpp.
|
inline |
Return the specified number of elements as a vector or row vector (same as input) from the back of the specified vector or row vector.
| T | type of the vector |
| v | Vector input. |
| n | Size of return. |
| std::out_of_range | if n is out of range. |
|
inline |
Return the specified number of elements as a vector or row vector (same as input) from the back of the specified vector or row vector.
| T_x | type of input kernel generator expression. |
| x | input kernel generator expression. |
| n | Size of return. |
| std::out_of_range | if n is out of range. |
| std::vector<T> stan::math::tail | ( | const std::vector< T > & | sv, |
| size_t | n | ||
| ) |
Return the specified number of elements as a standard vector from the back of the specified standard vector.
| T | type of elements in the vector |
| sv | Standard vector. |
| n | Size of return. |
| std::out_of_range | if n is out of range. |
|
inline |
Return the tangent of a radian-scaled variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \tan x = \sec^2 x\).
\[ \mbox{tan}(x) = \begin{cases} \tan(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{tan}(x)}{\partial x} = \begin{cases} \sec^2(x) & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Variable for radians of angle. |
|
inline |
|
inline |
Return the hyperbolic tangent of the specified variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \tanh x = \frac{1}{\cosh^2 x}\).
\[ \mbox{tanh}(x) = \begin{cases} \tanh(x) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{tanh}(x)}{\partial x} = \begin{cases} \mbox{sech}^2(x) & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Variable. |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 16 of file tcrossprod.hpp.
|
inline |
Returns the result of post-multiplying a matrix by its own transpose.
| T | type of elements in A |
| A | input matrix |
Definition at line 21 of file tcrossprod.hpp.
|
inline |
Returns the result of post-multiplying a matrix by its own transpose.
| T | Type of the matrix |
| M | Matrix to multiply. |
Definition at line 22 of file tcrossprod.hpp.
|
inline |
Returns the result of post-multiplying a matrix by its own transpose.
| T | type of the matrix (must be derived from Eigen::MatrixBase) |
| M | Matrix to multiply. |
Definition at line 23 of file tcrossprod.hpp.
|
inline |
Returns the result of post-multiplying a matrix by its own transpose.
| T | Type of the matrix |
| M | Matrix to multiply. |
Definition at line 24 of file tcrossprod.hpp.
|
inline |
Return the gamma function applied to the specified argument.
| x | Argument. |
Definition at line 19 of file tgamma.hpp.
|
inline |
Returns the elementwise tgamma() of a var_value<matrix_cl<double>>.
| A | argument |
tgamma() of the input. Definition at line 20 of file tgamma.hpp.
Return the result of applying the gamma function to the specified argument.
| T | inner type of the fvar |
| x | Argument. |
Definition at line 21 of file tgamma.hpp.
Return the Gamma function applied to the specified variable (C99).
The derivative with respect to the argument is
\(\frac{d}{dx} \Gamma(x) = \Gamma(x) \Psi^{(0)}(x)\)
where \(\Psi^{(0)}(x)\) is the digamma function.
\[ \mbox{tgamma}(x) = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \Gamma(x) & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{tgamma}(x)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \frac{\partial\, \Gamma(x)}{\partial x} & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \Gamma(x)=\int_0^{\infty} u^{x - 1} \exp(-u) \, du \]
\[ \frac{\partial \, \Gamma(x)}{\partial x} = \Gamma(x)\Psi(x) \]
| a | Argument to function. |
Definition at line 48 of file tgamma.hpp.
|
inline |
Vectorized version of tgamma().
| T | type of container |
| x | container |
| std::domain_error | if any value is 0 or a negative integer |
Definition at line 53 of file tgamma.hpp.
|
inline |
Return elementwise gamma function.
| a | input |
Definition at line 62 of file tgamma.hpp.
|
inline |
Throw a domain error with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing domain errors. This will allow us to change the behavior for all functions at once. The message is: "<function>: <name> <msg1><y><msg2>"
| T | Type of variable. |
| [in] | function | Name of the function. |
| [in] | name | Name of the variable. |
| [in] | y | Variable. |
| [in] | msg1 | Message to print before the variable. |
| [in] | msg2 | Message to print after the variable. |
| std::domain_error | Always. |
Definition at line 26 of file throw_domain_error.hpp.
|
inline |
Throw a domain error with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing domain errors. This will allow us to change the behavior for all functions at once. The message is: * "<function>: <name> <msg1><y>"
| T | Type of variable. |
| [in] | function | Name of the function. |
| [in] | name | Name of the variable. |
| [in] | y | Variable. |
| [in] | msg1 | Message to print before the variable. |
| std::domain_error | Always. |
Definition at line 49 of file throw_domain_error.hpp.
|
inline |
Throw a domain error with a consistently formatted message for matrices.
This is an abstraction for all Stan functions to use when throwing domain errors. This will allow us to change the behavior for all functions at once. The message is: "<function>: <name>[<i+error_index, j+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.
| T | Type of variable |
| function | Name of the function |
| name | Name of the variable |
| y | Variable |
| i | Row index |
| j | Column index |
| msg1 | Message to print before the variable |
| msg2 | Message to print after the variable |
| std::domain_error | Always. |
Definition at line 32 of file throw_domain_error_mat.hpp.
|
inline |
Throw a domain error with a consistently formatted message for matrices.
This is an abstraction for all Stan functions to use when throwing domain errors. This will allow us to change the behavior for all functions at once. The message is: "<function>: <name>[<i+error_index, j+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.
| T | Type of variable |
| function | Name of the function |
| name | Name of the variable |
| y | Variable |
| i | Row index |
| j | Column index |
| msg | Message to print before the variable |
| std::domain_error | Always |
Definition at line 66 of file throw_domain_error_mat.hpp.
|
inline |
Throw a domain error with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing domain errors. This will allow us to change the behavior for all functions at once. The message is: "<function>: <name>[<i+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.
| T | Type of variable |
| function | Name of the function |
| name | Name of the variable |
| y | Variable |
| i | Index |
| msg1 | Message to print before the variable |
| msg2 | Message to print after the variable |
| std::domain_error | Always. |
Definition at line 31 of file throw_domain_error_vec.hpp.
|
inline |
Throw a domain error with a consistently formatted message.
This is an abstraction for all Stan functions to use when throwing domain errors. This will allow us to change the behavior for all functions at once. The message is: "<function>: <name>[<i+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.
| T | Type of variable |
| function | Name of the function |
| name | Name of the variable |
| y | Variable |
| i | Index |
| msg | Message to print before the variable |
| std::domain_error | Always |
Definition at line 57 of file throw_domain_error_vec.hpp.
| arena_t<T> stan::math::to_arena | ( | const T & | a | ) |
Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered.
This overload is used for matrix_cl. It is converted to a subclass that schedules its destructor to be called when the memory is recovered.
| T | type of scalar |
| a | argument |
Definition at line 25 of file to_arena.hpp.
|
inline |
Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered.
This overload is used for kernel generator expressions. It also handles any other types that do not have a special overload for them.
| T | type of scalar |
| a | argument |
Definition at line 28 of file to_arena.hpp.
|
inline |
Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered.
For types that already have this property (including scalars and var_values) this is a no-op.
Passing in a lvalue reference to objects not using AD stack, such as a matrix_cl is inefficient as they need to be copied in this case.
| T | type of scalar |
| a | argument |
Definition at line 49 of file to_arena.hpp.
|
inline |
Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered.
Converts eigen types to arena_matrix.
| T | type of argument |
| a | argument |
Definition at line 67 of file to_arena.hpp.
|
inline |
Converts given argument into a type that either has any dynamic allocation on AD stack or schedules its destructor to be called when AD stack memory is recovered.
For std vectors that have data already on AD stack this is a shallow copy.
| T | type of scalar |
| a | argument |
Definition at line 82 of file to_arena.hpp.
|
inline |
Converts given argument into a type that has any dynamic allocation on AD stack.
Std vectors are copied into another std vector with custom allocator that uses AD stack.
This overload works on vectors with simple scalars that don't need to be converthed themselves.
| T | type of argument |
| a | argument |
Std vectors are copied into another std vector with custom allocator that uses AD stack.
This overload works on vectors with scalars that also need conversion.
| T | type of argument |
| a | argument |
Definition at line 109 of file to_arena.hpp.
|
inline |
If the condition is true, converts given argument into a type that has any dynamic allocation on AD stack.
Otherwise returns the argument
| T | type of argument |
| a | argument |
Definition at line 145 of file to_arena.hpp.
|
inline |
Definition at line 150 of file to_arena.hpp.
|
inline |
Definition at line 15 of file to_array_1d.hpp.
|
inline |
Definition at line 27 of file to_array_1d.hpp.
|
inline |
Definition at line 33 of file to_array_1d.hpp.
|
inline |
Definition at line 13 of file to_array_2d.hpp.
|
inline |
Return a complex value from a real component and an imaginary component.
Default values for both components is 0.
| T | type of real component |
| S | type of imaginary component |
| [in] | re | real component (default = 0) |
| [in] | im | imaginary component (default = 0) |
Definition at line 22 of file to_complex.hpp.
|
inline |
Definition at line 15 of file to_fvar.hpp.
|
inline |
Specialization of to_fvar for [containers of] fvars.
| [in,out] | x | A forward automatic differentation variables. |
Definition at line 26 of file to_fvar.hpp.
|
inline |
Definition at line 31 of file to_fvar.hpp.
|
inline |
Definition at line 40 of file to_fvar.hpp.
|
inline |
Definition at line 51 of file to_fvar.hpp.
|
inline |
Definition at line 60 of file to_fvar.hpp.
|
inline |
Returns a matrix with dynamic dimensions constructed from an Eigen matrix which is either a row vector, column vector, or matrix.
The runtime dimensions will be the same as the input.
| EigMat | type of the matrix |
| x | matrix |
Definition at line 24 of file to_matrix.hpp.
|
inline |
Returns a matrix representation of a vector or matrix in column-major order with the specified number of rows and columns.
| T_x | type of the matrix |
| x | matrix |
| m | rows |
| n | columns |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 27 of file to_matrix.hpp.
|
inline |
Returns a matrix representation of a standard vector of Eigen row vectors with the same dimensions and indexing order.
| T | type of the elements in the vector |
| x | Eigen vector of vectors of scalar values |
Definition at line 37 of file to_matrix.hpp.
|
inline |
Returns a matrix representation of a vector or matrix in column-major order with the specified number of rows and columns.
| T_x | type of the matrix |
| x | matrix |
| m | rows |
| n | columns |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 40 of file to_matrix.hpp.
|
inline |
Returns a matrix representation of the standard vector of standard vectors with the same dimensions and indexing order.
| T | type of elements in the vector |
| x | vector of vectors of scalar values |
Definition at line 63 of file to_matrix.hpp.
|
inline |
Returns a matrix representation of the vector or matrix in column-major or row major order with the specified number of rows and columns.
| T_x | type of the matrix |
| x | matrix |
| m | rows |
| n | columns |
| col_major | column-major indicator if 1, output matrix is transversed in column-major order if 0, output matrix is transversed in row-major order |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 70 of file to_matrix.hpp.
|
inline |
Returns a matrix representation of the vector in column-major order with the specified number of rows and columns.
| EigMat | type of the matrix |
| x | matrix |
| m | rows |
| n | columns |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 94 of file to_matrix.hpp.
|
inline |
Returns a matrix representation of the vector in column-major order with the specified number of rows and columns.
| T | type of elements in the vector |
| x | vector of values |
| m | rows |
| n | columns |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 116 of file to_matrix.hpp.
|
inline |
Returns a matrix representation of the vector in column-major order with the specified number of rows and columns.
| x | vector of values |
| m | rows |
| n | columns |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 134 of file to_matrix.hpp.
|
inline |
Returns a matrix representation of the vector in column-major order with the specified number of rows and columns.
| EigMat | type of the matrix |
| x | matrix |
| m | rows |
| n | columns |
| col_major | column-major indicator: if 1, output matrix is transversed in column-major order, if 0, output matrix is transversed in row-major order, otherwise function throws std::invalid_argument |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 165 of file to_matrix.hpp.
|
inline |
Returns a matrix representation of the vector in column-major order with the specified number of rows and columns.
| T | type of elements in the vector |
| x | vector of values |
| m | rows |
| n | columns |
| col_major | column-major indicator: if 1, output matrix is transversed in column-major order, if 0, output matrix is transversed in row-major order, otherwise function throws std::invalid_argument |
| <code>std::invalid_argument</code> | if the sizes do not match |
Definition at line 194 of file to_matrix.hpp.
|
inline |
This evaluates expensive Eigen expressions.
If given expression involves no calculations this is a no-op that should be optimized away.
| T | argument type |
| a | argument |
Definition at line 17 of file to_ref.hpp.
|
inline |
Converts given Eigen expression into one that can be directly copied to an OpenCL device to create matrix_cl.
If given expression can be directly copied, this is a no-op that should be optimized away.
| T | argument type |
| a | argument |
Definition at line 19 of file to_ref_for_opencl.hpp.
|
inline |
No-op that should be optimized away.
| Cond | condition |
| T | argument type |
| a | argument |
Definition at line 29 of file to_ref.hpp.
|
inline |
If the condition is true, evaluates expensive Eigen expressions.
If given expression involves no calculations this is a no-op that should be optimized away.
| Cond | condition |
| T | argument type (Eigen expression) |
| a | argument |
Eigen::Ref Definition at line 43 of file to_ref.hpp.
|
inline |
Definition at line 15 of file to_row_vector.hpp.
|
inline |
Definition at line 28 of file to_row_vector.hpp.
|
inline |
Definition at line 34 of file to_row_vector.hpp.
|
inline |
Converts argument to an automatic differentiation variable.
Returns a var variable with the input value.
| [in] | x | A scalar value |
Definition at line 22 of file to_var.hpp.
Specialization of to_var for non-const var input.
| [in,out] | x | An automatic differentiation variable. |
Definition at line 30 of file to_var.hpp.
Specialization of to_var for const var input.
| [in,out] | x | An automatic differentiation variable. |
Definition at line 38 of file to_var.hpp.
|
inline |
Converts argument to an automatic differentiation variable.
Returns a var variable with the input value.
| [in] | v | A std::vector<double> |
Definition at line 48 of file to_var.hpp.
Specialization of to_var to for const input vector of var.
Returns a var variable from the input
| [in] | v | A std::vector<var> |
Definition at line 64 of file to_var.hpp.
Specialization of to_var to for non-const input vector of var.
Returns a var variable from the input
| [in] | v | A std::vector<var> |
Definition at line 74 of file to_var.hpp.
Converts argument to an automatic differentiation variable.
Returns a var variable with the input value.
| [in] | m | A Matrix with scalars |
Definition at line 84 of file to_var.hpp.
Specialization of to_var for non-const matrices of vars.
| [in,out] | m | A matrix of automatic differentation variables. |
Definition at line 95 of file to_var.hpp.
Specialization of to_var for const matrices of vars.
| [in,out] | m | A matrix of automatic differentation variables. |
Definition at line 103 of file to_var.hpp.
Converts argument to an automatic differentiation variable.
Returns a var variable with the input value.
| [in] | v | A Vector of scalars |
Definition at line 114 of file to_var.hpp.
Specialization of to_var for const column vector of vars.
| [in,out] | v | A column vector of automatic differentation variables. |
Definition at line 125 of file to_var.hpp.
Specialization of to_var for non-const column vector of vars.
| [in,out] | v | A column vector of automatic differentation variables. |
Definition at line 133 of file to_var.hpp.
|
inline |
Converts argument to an automatic differentiation variable.
Returns a var variable with the input value.
| [in] | rv | A row vector of scalars |
Definition at line 144 of file to_var.hpp.
|
inline |
Specialization of to_var for const row vector of vars.
| [in,out] | rv | A column vector of automatic differentation variables. |
Definition at line 155 of file to_var.hpp.
|
inline |
Specialization of to_var for non-const row vector of vars.
| [in,out] | rv | A column vector of automatic differentation variables. |
Definition at line 163 of file to_var.hpp.
| var_value<Eigen::Matrix<double, T::RowsAtCompileTime, T::ColsAtCompileTime> > stan::math::to_var_value | ( | const T & | a | ) |
Converts an Eigen matrix (or vector or row_vector) or expression of vars into var_value.
Adjoint is propagated back to argument in the reverse pass.
| T | type of the input |
| a | matrix to convert |
Definition at line 22 of file to_var_value.hpp.
| T stan::math::to_var_value | ( | T && | a | ) |
This is a no-op for var_values.
| T | type of the input |
| a | matrix to convert |
Definition at line 37 of file to_var_value.hpp.
| auto stan::math::to_var_value | ( | const std::vector< T > & | a | ) |
Convert the elements of the std::vector input to var_value types if possible.
| T | type of elemnts of the input vector |
| a | std::vector of elements to convert |
Definition at line 49 of file to_var_value.hpp.
|
inline |
Definition at line 15 of file to_vector.hpp.
|
inline |
Reshape a var_value<Matrix> to a var_value<ColumnVector>.
| EigMat | Inner type of the var_value that must inherit from Eigen::EigenBase. |
| x | A var whose inner matrix type is to be reshaped to an Column matrix. |
x with inner value and adjoint matrices mapped to a column vector. Definition at line 20 of file to_vector.hpp.
|
inline |
Definition at line 28 of file to_vector.hpp.
|
inline |
Definition at line 34 of file to_vector.hpp.
|
inline |
Returns the trace of the specified matrix.
The trace is defined as the sum of the elements on the diagonal. The matrix is not required to be square. Returns 0 if matrix is empty.
| T | type of the elements in the matrix |
| [in] | m | Specified matrix. |
| value_type_t<T> stan::math::trace | ( | const T & | m | ) |
|
inline |
Returns the trace of the specified matrix.
The trace is defined as the sum of the elements on the diagonal. The matrix is not required to be square. Returns 0 if matrix is empty.
| T | type of the elements in the matrix |
| [in] | m | Specified matrix. |
|
inline |
Compute the trace of an inverse quadratic form premultiplied by a square matrix.
This computes trace(D B^T A^-1 B) where D is a square matrix and the LDLT_factor of A is provided.
| Td | type of the first matrix |
| Ta | type of matrix in the LDLT_factor |
| Tb | type of the second matrix |
| D | a square matrix |
| A | an LDLT_factor |
| B | a matrix |
Definition at line 33 of file trace_gen_inv_quad_form_ldlt.hpp.
|
inline |
Compute the trace of an inverse quadratic form.
I.E., this computes trace(D B^T A^-1 B) where D is a square matrix and the LDLT_factor of A is provided.
| EigMat1 | type of the first matrix |
| T2 | type of matrix in the LDLT_factor |
| EigMat3 | type of the third matrix |
| D | multiplier |
| A | LDLT_factor |
| B | inner term in quadratic form |
| std::domain_error | if D is not square |
| std::domain_error | if A cannot be multiplied by B or B cannot be multiplied by D. |
Definition at line 36 of file trace_gen_inv_quad_form_ldlt.hpp.
|
inline |
Compute the trace of an inverse quadratic form.
I.E., this computes trace(diag(D) B^T A^-1 B) where D is the diagonal of a diagonal matrix (diag(D) is the diagonal matrix itself) and the LDLT_factor of A is provided.
| EigVec | type of the diagonal of first matrix |
| T | type of matrix in the LDLT_factor |
| EigMat | type of the B matrix |
| D | diagonal of multiplier |
| A | LDLT_factor |
| B | inner term in quadratic form |
| std::domain_error | if A cannot be multiplied by B or B cannot be multiplied by diag(D). |
Definition at line 69 of file trace_gen_inv_quad_form_ldlt.hpp.
|
inline |
Compute the trace of an inverse quadratic form.
I.E., this computes trace(diag(D) B^T A^-1 B) where D is the diagonal of a diagonal matrix (diag(D) is the diagonal matrix itself) and the LDLT_factor of A is provided.
| Td | type of the diagonal of first matrix |
| Ta | type of matrix in the LDLT_factor |
| Tb | type of the B matrix |
| D | diagonal of multiplier |
| A | LDLT_factor |
| B | inner term in quadratic form |
| std::domain_error | if A cannot be multiplied by B or B cannot be multiplied by diag(D). |
Definition at line 190 of file trace_gen_inv_quad_form_ldlt.hpp.
|
inline |
Return the trace of D times the quadratic form of B and A.
That is, `trace_gen_quad_form(D, A, B) = trace(D * B' * A * B).`
| TD | type of the first matrix or expression |
| TA | type of the second matrix or expression |
| TB | type of the third matrix or expression |
| D | multiplier |
| A | outside term in quadratic form |
| B | inner term in quadratic form |
| std::domain_error | if A or D is not square |
| std::domain_error | if A cannot be multiplied by B or B cannot be multiplied by D. |
Definition at line 36 of file trace_gen_quad_form.hpp.
|
inline |
Return the trace of D times the quadratic form of B and A.
That is, `trace_gen_quad_form(D, A, B) = trace(D * B' * A * B).` This is the overload for arithmetic types to allow Eigen's expression templates to be used for efficiency.
| EigMatD | type of the first matrix or expression |
| EigMatA | type of the second matrix or expression |
| EigMatB | type of the third matrix or expression |
| D | multiplier |
| A | outside term in quadratic form |
| B | inner term in quadratic form |
| std::domain_error | if A or D is not square |
| std::domain_error | if A cannot be multiplied by B or B cannot be multiplied by D. |
Definition at line 66 of file trace_gen_quad_form.hpp.
|
inline |
Return the trace of D times the quadratic form of B and A.
That is, `trace_gen_quad_form(D, A, B) = trace(D * B' * A * B).`
This overload requires one of D, A, or B to be a var_value<T> where T inherits from EigenBase
| TD | type of first matrix argument |
| TA | type of second matrix argument |
| TB | type of third matrix argument |
| D | multiplier |
| A | outside term in quadratic form |
| B | inner term in quadratic form |
| std::domain_error | if A or D is not square |
| std::domain_error | if A cannot be multiplied by B or B cannot be multiplied by D. |
Definition at line 92 of file trace_gen_quad_form.hpp.
|
inline |
Compute the trace of an inverse quadratic form.
I.E., this computes trace(B^T A^-1 B) where the LDLT_factor of A is provided.
| T | type of the first matrix and the LDLT_factor |
| EigMat2 | type of the second matrix |
| A | first matrix as LDLT |
| B | second matrix |
Definition at line 28 of file trace_inv_quad_form_ldlt.hpp.
|
inline |
Compute the trace of an inverse quadratic form premultiplied by a square matrix.
This computes trace(B^T A^-1 B) where the LDLT_factor of A is provided.
| T1 | type of elements in the LDLT_factor |
| T2 | type of the second matrix |
| A | an LDLT_factor |
| B | a matrix |
Definition at line 32 of file trace_inv_quad_form_ldlt.hpp.
|
inline |
Definition at line 18 of file trace_quad_form.hpp.
|
inline |
Compute trace(B^T A B).
| EigMat1 | type of the first matrix |
| EigMat2 | type of the second matrix |
| A | matrix |
| B | matrix |
| std::domain_error | if A is not square |
| std::domain_error | if A cannot be multiplied by B |
Definition at line 26 of file trace_quad_form.hpp.
|
inline |
Compute trace(B^T A B).
This overload handles arguments where one of Mat1 or Mat2 are var_value<T> where T is an Eigen type. The other type can also be a var_value or it can be a type that inherits from EigenBase
| Mat1 | type of the first matrix |
| Mat2 | type of the second matrix |
| A | matrix |
| B | matrix |
| std::domain_error | if A is not square |
| std::domain_error | if A cannot be multiplied by B |
Definition at line 118 of file trace_quad_form.hpp.
|
inline |
Transposes a matrix.
| T | type of the matrix or expression |
| m | matrix or expression |
Definition at line 17 of file transpose.hpp.
|
inline |
Transposes a matrix.
| M | input matrix |
Definition at line 19 of file transpose.hpp.
Return the value of the trigamma function at the specified argument (i.e., the second derivative of the log Gamma function at the specified argument).
| T | inner type of the fvar |
| u | argument |
Definition at line 21 of file trigamma.hpp.
Return the value of the trigamma function at the specified argument (i.e., the second derivative of the log Gamma function at the specified argument).
| u | argument |
Definition at line 23 of file trigamma.hpp.
|
inline |
Return the second derivative of the log Gamma function evaluated at the specified argument.
\[ \mbox{trigamma}(x) = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \Psi_1(x) & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{trigamma}(x)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \frac{\partial\, \Psi_1(x)}{\partial x} & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \Psi_1(x)=\sum_{n=0}^\infty \frac{1}{(x+n)^2} \]
\[ \frac{\partial \, \Psi_1(x)}{\partial x} = -2\sum_{n=0}^\infty \frac{1}{(x+n)^3} \]
| [in] | u | argument |
Definition at line 120 of file trigamma.hpp.
|
inline |
Return the second derivative of the log Gamma function evaluated at the specified argument.
| [in] | u | argument |
Definition at line 129 of file trigamma.hpp.
|
inline |
Return the elementwise application of trigamma() to specified argument container.
The return type promotes the underlying scalar argument type to double if it is an integer, and otherwise is the argument type.
| T | type of container |
| x | container |
Definition at line 161 of file trigamma.hpp.
|
inline |
Return the trigamma function applied to the argument.
The trigamma function returns the second derivative of the log Gamma function evaluated at the specified argument. This base templated version is used in prim, fwd, and rev implementations.
| T | scalar argument type |
| x | argument |
Definition at line 37 of file trigamma.hpp.
|
inline |
Return the elementwise application of trunc() to specified argument container.
The return type promotes the underlying scalar argument type to double if it is an integer, and otherwise is the argument type.
| T | type of container |
| x | container |
Returns the truncation of the specified variable (C99).
See trunc() for the double-based version.
The derivative is zero everywhere but at integer values, so for convenience the derivative is defined to be everywhere zero,
\(\frac{d}{dx} \mbox{trunc}(x) = 0\).
\[ \mbox{trunc}(x) = \begin{cases} \lfloor x \rfloor & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{trunc}(x)}{\partial x} = \begin{cases} 0 & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
| a | Specified variable. |
|
inline |
Determines a string name of a type.
Unsupported types fail static assert.
Definition at line 14 of file type_str.hpp.
|
inline |
Definition at line 27 of file type_str.hpp.
|
inline |
Definition at line 26 of file type_str.hpp.
|
inline |
Definition at line 24 of file type_str.hpp.
|
inline |
Definition at line 25 of file type_str.hpp.
|
inline |
Return the upper-bounded value for the specified unconstrained matrix and upper bound.
The transform is
\(f(x) = U - \exp(x)\)
where \(U\) is the upper bound.
| T | type of Matrix |
| U | type of upper bound |
| [in] | x | free Matrix. |
| [in] | ub | upper bound |
Definition at line 32 of file ub_constrain.hpp.
|
inline |
Return the upper-bounded value for the specified unconstrained matrix and upper bound.
Specialization of ub_constrain to apply a matrix of upper bounds elementwise to each input element.
The transform is
\(f(x) = U - \exp(x)\)
where \(U\) is the upper bound.
| T | type of Matrix |
| U | type of upper bound |
| [in] | x | free Matrix. |
| [in] | ub | upper bound |
| T | A type inheriting from EigenBase. |
| U | A type inheriting from EigenBase. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
The transform is
\(f(x) = U - \exp(x)\)
where \(U\) is the upper bound.
| T | Scalar |
| U | Scalar |
| [in] | x | free Matrix. |
| [in] | ub | upper bound |
| T | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| U | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
Definition at line 36 of file ub_constrain.hpp.
|
inline |
Return the upper-bounded value for the specified unconstrained input and specified upper bound.
The transform applied is
\(f(x) = U - \exp(x)\)
where \(U\) is the constant upper bound.
| T_x | kernel generator expression |
| T_ub | kernel generator expression |
| [in] | x | unconstrained input |
| [in] | ub | upper bound |
Definition at line 39 of file ub_constrain.hpp.
|
inline |
Return the upper-bounded value for the specified unconstrained matrix and upper bound.
Specialization of ub_constrain to apply a matrix of upper bounds elementwise to each input element.
Return the upper-bounded value for the specified unconstrained scalar and upper bound and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.
The transform is
\(f(x) = U - \exp(x)\)
where \(U\) is the upper bound.
| T | type of Matrix |
| U | type of upper bound |
| [in] | x | free Matrix. |
| [in] | ub | upper bound |
| [in,out] | lp | reference to log probability to increment |
The transform is as specified for ub_constrain(T, double). The log absolute Jacobian determinant is
\( \log | \frac{d}{dx} -\mbox{exp}(x) + U | = \log | -\mbox{exp}(x) + 0 | = x\).
| T | type of scalar |
| U | type of upper bound |
| [in] | x | free scalar |
| [in] | ub | upper bound |
| [in,out] | lp | log density |
| T | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| U | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 60 of file ub_constrain.hpp.
|
inline |
Return the upper-bounded value for the specified unconstrained scalar and upper bound and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.
Specialization of ub_constrain to apply a matrix of upper bounds elementwise to each input element.
The transform is as specified for ub_constrain(T, double). The log absolute Jacobian determinant is
\( \log | \frac{d}{dx} -\mbox{exp}(x) + U | = \log | -\mbox{exp}(x) + 0 | = x\).
| T | type of scalar |
| U | type of upper bound |
| S | type of log probability |
| [in] | x | free scalar |
| [in] | ub | upper bound |
| [in,out] | lp | log density |
| T | A type inheriting from EigenBase. |
| U | A type inheriting from EigenBase. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 67 of file ub_constrain.hpp.
|
inline |
Return the upper-bounded value for the specified unconstrained input and specified upper bound.
The transform applied is
\(f(x) = U - \exp(x)\)
where \(U\) is the constant upper bound.
| T_x | kernel generator expression |
| T_ub | kernel generator expression |
| [in] | x | unconstrained input |
| [in] | ub | upper bound |
| [in,out] | lp | reference to log probability to increment |
Definition at line 75 of file ub_constrain.hpp.
|
inline |
Specialization of ub_constrain to apply a scalar upper bound elementwise to each input.
| T | A type inheriting from EigenBase. |
| U | Scalar. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
| T | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| U | Scalar. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
Definition at line 90 of file ub_constrain.hpp.
|
inline |
Specialization of ub_constrain to apply a scalar upper bound elementwise to each input.
| T | A type inheriting from EigenBase. |
| U | Scalar. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 108 of file ub_constrain.hpp.
|
inline |
Specialization of ub_constrain to apply a scalar upper bound elementwise to each input element.
| T | A Any type with a Scalar scalar_type. |
| U | Scalar. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
Definition at line 163 of file ub_constrain.hpp.
|
inline |
Specialization of ub_constrain to apply a scalar upper bound elementwise to each input element.
| T | A Any type with a Scalar scalar_type. |
| U | Scalar. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 183 of file ub_constrain.hpp.
|
inline |
Specialization of ub_constrain to apply a scalar upper bound elementwise to each input.
| T | A type inheriting from EigenBase or a var_value with inner type inheriting from EigenBase. |
| U | Scalar. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 187 of file ub_constrain.hpp.
|
inline |
Specialization of ub_constrain to apply a container of upper bounds elementwise to each input element.
| T | A Any type with a Scalar scalar_type. |
| U | A type inheriting from EigenBase or a standard vector. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
Definition at line 203 of file ub_constrain.hpp.
|
inline |
Specialization of ub_constrain to apply a container of upper bounds elementwise to each input element.
| T | A Any type with a Scalar scalar_type. |
| U | A type inheriting from EigenBase or a standard vector. |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
| [in,out] | lp | reference to log probability to increment |
Definition at line 224 of file ub_constrain.hpp.
|
inline |
Specialization of ub_constrain to apply a container of upper bounds elementwise to each input element.
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| U | A type inheriting from Eigen::EigenBase, a var_value with inner type inheriting from Eigen::EigenBase, a standard vector, or a scalar |
| [in] | x | unconstrained input |
| [in] | ub | upper bound on output |
| [in,out] | lp | log density accumulator |
Definition at line 253 of file ub_constrain.hpp.
|
inline |
Return the free scalar that corresponds to the specified upper-bounded value with respect to the specified upper bound.
The transform is the reverse of the ub_constrain(T, double) transform,
\(f^{-1}(y) = \log -(y - U)\)
where \(U\) is the upper bound.
| T | type of scalar |
| U | type of upper bound |
| y | constrained scalar with specified upper bound |
| ub | upper bound |
| std::invalid_argument | if constrained scalar is greater than the upper bound. |
Definition at line 35 of file ub_free.hpp.
|
inline |
Return the free matrix that corresponds to the specified upper-bounded matrix with respect to the specified upper bound.
The transform is the reverse of the ub_constrain transform.
| T | type of matrix |
| U | type of upper bound |
| y | constrained matrix with specified upper bound |
| ub | upper bound |
| std::invalid_argument | if any element of constrained variable is greater than the upper bound. |
Definition at line 63 of file ub_free.hpp.
|
inline |
Return the free variable that corresponds to the specified upper-bounded variable with respect to the specified upper bound.
The transform is the reverse of the ub_constrain transform.
| T | type of constrained variable |
| U | type of upper bound |
| y | constrained variable with specified upper bound |
| ub | upper bound |
| std::invalid_argument | if any element of constrained variable is greater than the upper bound. |
Definition at line 91 of file ub_free.hpp.
|
inline |
Return the free variable that corresponds to the specified upper-bounded variable with respect to the specified upper bound.
The transform is the reverse of the ub_constrain transform.
| T | type of constrained variable |
| U | type of upper bound |
| y | constrained variable with specified upper bound |
| ub | upper bound |
| std::invalid_argument | if any element of constrained variable is greater than the upper bound. |
Definition at line 115 of file ub_free.hpp.
| return_type_t<T_y, T_low, T_high> stan::math::uniform_cdf | ( | const T_y & | y, |
| const T_low & | alpha, | ||
| const T_high & | beta | ||
| ) |
Definition at line 23 of file uniform_cdf.hpp.
| return_type_t<T_y, T_low, T_high> stan::math::uniform_lccdf | ( | const T_y & | y, |
| const T_low & | alpha, | ||
| const T_high & | beta | ||
| ) |
Definition at line 25 of file uniform_lccdf.hpp.
| return_type_t<T_y, T_low, T_high> stan::math::uniform_lcdf | ( | const T_y & | y, |
| const T_low & | alpha, | ||
| const T_high & | beta | ||
| ) |
Definition at line 25 of file uniform_lcdf.hpp.
|
inline |
Definition at line 117 of file uniform_lpdf.hpp.
|
inline |
Return a uniform simplex of size K.
| K | size of the simplex |
| std::domain_error | if K is not positive. |
Definition at line 18 of file uniform_simplex.hpp.
|
inline |
Definition at line 20 of file unit_vector_constrain.hpp.
|
inline |
Return the unit length vector corresponding to the free vector y.
See https://en.wikipedia.org/wiki/N-sphere#Generating_random_points
| T | type of the value of input matrix |
| A | vector of K unrestricted variables |
Definition at line 22 of file unit_vector_constrain.hpp.
|
inline |
Return the unit length vector corresponding to the given free vector.
See the Wikipedia page on generating random points on an N-sphere.
| T_x | type of the vector |
| x | vector of unrestricted variables |
Definition at line 24 of file unit_vector_constrain.hpp.
|
inline |
Return the unit length vector corresponding to the free vector y.
See the Wikipedia page on generating random points on an N-sphere.
| T | type inheriting from EigenBase that does not have an fvar scalar type. |
| y | vector of K unrestricted variables |
Definition at line 27 of file unit_vector_constrain.hpp.
|
inline |
Return the unit length vector corresponding to the free vector y.
See https://en.wikipedia.org/wiki/N-sphere#Generating_random_points
| EigMat | type inheriting from EigenBase that has a var scalar type. |
| y | vector of K unrestricted variables |
Definition at line 30 of file unit_vector_constrain.hpp.
|
inline |
Definition at line 44 of file unit_vector_constrain.hpp.
|
inline |
Return the unit length vector corresponding to the free vector y.
See https://en.wikipedia.org/wiki/N-sphere#Generating_random_points
| T | type of the value of input matrix |
| A | vector of K unrestricted variables |
| lp | Log probability reference to increment. |
Definition at line 45 of file unit_vector_constrain.hpp.
|
inline |
Return the unit length vector corresponding to the given free vector.
See the Wikipedia page on generating random points on an N-sphere.
| T_x | type of the vector |
| x | vector of unrestricted variables | |
| [in,out] | lp | log probability to increment |
Definition at line 46 of file unit_vector_constrain.hpp.
|
inline |
Return the unit length vector corresponding to the free vector y.
See https://en.wikipedia.org/wiki/N-sphere#Generating_random_points
| T1 | type inheriting from EigenBase that does not have an fvar scalar type. |
| y | vector of K unrestricted variables |
| lp | Log probability reference to increment. |
Definition at line 49 of file unit_vector_constrain.hpp.
|
inline |
Return the unit length vector corresponding to the free vector y.
See https://en.wikipedia.org/wiki/N-sphere#Generating_random_points
| EigMat | type inheriting from EigenBase that has a var scalar type. |
| y | vector of K unrestricted variables |
| lp | Log probability reference to increment. |
Definition at line 61 of file unit_vector_constrain.hpp.
|
inline |
Return the unit length vector corresponding to the free vector y.
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| y | vector of K unrestricted variables | |
| [in,out] | lp | log density accumulator |
If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.
| Jacobian | if true, increment log density accumulator with log absolute Jacobian determinant of constraining transform |
| T | A standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column |
| y | vector of K unrestricted variables | |
| [in,out] | lp | log density accumulator |
Definition at line 76 of file unit_vector_constrain.hpp.
|
inline |
Transformation of a unit length vector to a "free" vector However, we are just fixing the unidentified radius to 1.
Thus, the transformation is just the identity
| EigVec | A type derived from EigenBase with 1 compile time row or column. |
| x | unit vector of dimension K |
Definition at line 24 of file unit_vector_free.hpp.
| auto stan::math::unit_vector_free | ( | const T & | x | ) |
Overload of unit_vector_free() to untransform each Eigen vector in a standard vector.
| T | A standard vector with with a value_type which inherits from Eigen::MatrixBase with compile time rows or columns equal to 1. |
| x | The standard vector to untransform. |
Definition at line 39 of file unit_vector_free.hpp.
|
inline |
Return an array of integers in an ordered sequence.
This produces an array from low to high (included).
| low | smallest integer |
| high | largest integer |
| std::domain_error | if high is less than low. |
Definition at line 23 of file unitspaced_array.hpp.
|
inline |
Definition at line 12 of file validate_non_negative_index.hpp.
|
inline |
Check that simplex is at least size 1.
| var_name | Name of simplex variable |
| expr | Expression in which variable is declared |
| val | Size of simplex |
| std::invalid_argument | if simplex size is less than 1 |
Definition at line 20 of file validate_positive_index.hpp.
|
inline |
Check that unit vector is at least size 2.
| var_name | Name of unit vector variable |
| expr | Expression in which variable is declared |
| val | Size of unit vector |
| std::invalid_argument | if simplex size is less than 2 |
Definition at line 20 of file validate_unit_vector_index.hpp.
|
inline |
Return the value of the specified variable.
| T | inner type of the fvar |
| v | Variable. |
Definition at line 18 of file value_of.hpp.
|
inline |
Inputs that are arithmetic types or containers of airthmetric types are returned from value_of unchanged.
| T | Input type |
| [in] | x | Input argument |
Definition at line 21 of file value_of.hpp.
|
inline |
Return the value of the specified variable.
This function is used internally by autodiff functions along with value_of(T x) to extract the double value of either a scalar or an autodiff variable. This function will be called when the argument is a var even if the function is not referred to by namespace because of argument-dependent lookup.
| v | Variable. |
Definition at line 24 of file value_of.hpp.
|
inline |
Definition at line 28 of file value_of.hpp.
|
inline |
For std::vectors of non-arithmetic types, return a std::vector composed of value_of applied to each element.
| T | Input element type |
| [in] | x | Input std::vector |
Definition at line 50 of file value_of.hpp.
|
inline |
For Eigen matrices and expressions of non-arithmetic types, return an expression that represents the Eigen::Matrix resulting from applying value_of elementwise.
| EigMat | type of the matrix |
| [in] | M | Matrix to be converted |
Definition at line 72 of file value_of.hpp.
|
inline |
Return the value of the specified variable.
| v | Variable. |
Definition at line 17 of file value_of_rec.hpp.
|
inline |
Return the value of the specified variable.
| T | inner type of the fvar, must implement value_of_rec |
| v | Variable. |
Definition at line 20 of file value_of_rec.hpp.
|
inline |
Return the value of the specified scalar argument converted to a double value.
See the primitive_value function to extract values without casting to double.
This function is meant to cover the primitive types. For types requiring pass-by-reference, this template function should be specialized.
| T | Type of scalar. |
| x | Scalar to convert to double. |
Definition at line 29 of file value_of_rec.hpp.
|
inline |
Return the specified argument.
See value_of(T) for a polymorphic implementation using static casts.
This inline pass-through no-op should be compiled away.
| x | Specified value. |
Definition at line 44 of file value_of_rec.hpp.
|
inline |
Recursively apply value-of to the parts of the argument.
| T | value type of argument |
| [in] | x | argument |
Definition at line 54 of file value_of_rec.hpp.
|
inline |
Convert a std::vector of type T to a std::vector of doubles.
T must implement value_of_rec. See test/math/fwd/fun/value_of_rec.cpp for fvar and var usage.
| T | Scalar type in std::vector |
| [in] | x | std::vector to be converted |
Definition at line 69 of file value_of_rec.hpp.
|
inline |
Return the specified argument.
See value_of_rec(T) for a polymorphic implementation using static casts.
This inline pass-through no-op should be compiled away.
| x | Specified std::vector. |
See value_of_rec(T) for a polymorphic implementation using static casts.
This inline pass-through no-op should be compiled away.
| T | Type of matrix. |
| x | Specified matrix. |
Definition at line 91 of file value_of_rec.hpp.
|
inline |
Convert a matrix of type T to a matrix of doubles.
T must implement value_of_rec. See test/unit/math/fwd/fun/value_of_test.cpp for fvar and var usage.
| T | Type of matrix |
| [in] | M | Matrix to be converted |
Definition at line 107 of file value_of_rec.hpp.
|
inline |
Return the sample variance of the var_value matrix Raise domain error if size is not greater than zero.
| Mat | input matrix type |
| A | input |
Definition at line 24 of file variance.hpp.
|
inline |
Returns the sample variance (divide by length - 1) of the coefficients in the specified matrix.
| EigMat | type inheriting from EigenBase that does not have an var scalar type. |
| m | matrix |
| <code>std::invalid_argument</code> | if the matrix has size zero |
Definition at line 25 of file variance.hpp.
|
inline |
Return the sample variance of the var_value matrix Raise domain error if size is not greater than zero.
| T | input matrix type |
| a | input |
Definition at line 25 of file variance.hpp.
Return the sample variance of the specified standard vector.
Raise domain error if size is not greater than zero.
| [in] | v | a vector |
Definition at line 42 of file variance.hpp.
|
inline |
Returns the sample variance (divide by length - 1) of the coefficients in the specified standard vector.
| StdVec | A standard library vector that does not contain a var. |
| v | specified vector |
| <code>std::invalid_argument</code> | if the vector has size zero |
Definition at line 46 of file variance.hpp.
| var stan::math::variance | ( | const EigMat & | m | ) |
Return the sample variance of the specified vector, row vector, or matrix.
Raise domain error if size is not greater than zero.
| EigMat | type inheriting from EigenBase that has a var scalar type. |
| [in] | m | input matrix |
Definition at line 61 of file variance.hpp.
|
inline |
Return the sample variance of the var_value matrix Raise domain error if size is not greater than zero.
| Mat | input matrix type |
| [in] | x | a input |
Definition at line 79 of file variance.hpp.
|
inline |
Get the event stack from a vector of events and other arguments.
| Vec | type of elements in the array |
| Args | types for variadic arguments |
| v1 | event stack to roll up |
| args | variadic arguments passed down to the next recursion |
Definition at line 55 of file vec_concat.hpp.
| return_type_t<T_y, T_loc, T_scale> stan::math::von_mises_lpdf | ( | T_y const & | y, |
| T_loc const & | mu, | ||
| T_scale const & | kappa | ||
| ) |
Definition at line 26 of file von_mises_lpdf.hpp.
|
inline |
Definition at line 92 of file von_mises_lpdf.hpp.
|
inline |
Definition at line 117 of file weibull_lpdf.hpp.
|
inline |
Definition at line 210 of file wiener_lpdf.hpp.
|
inline |
Definition at line 102 of file wishart_lpdf.hpp.
|
inline |
Definition at line 15 of file wishart_rng.hpp.
|
inlinenoexcept |
End of recursion for set_zero_adjoints.
Definition at line 14 of file zero_adjoints.hpp.
|
inlinenoexcept |
Do nothing for non-autodiff arguments.
Recursively call zero_adjoints on the rest of the arguments.
| T | type of current argument |
| Pargs | type of rest of arguments |
| x | current argument |
| args | rest of arguments to zero |
Definition at line 27 of file zero_adjoints.hpp.
|
inline |
Zero the adjoint of the vari in the first argument.
Recursively call zero_adjoints on the rest of the arguments.
| T | type of current argument |
| Pargs | type of rest of arguments |
| x | current argument |
| args | rest of arguments to zero |
Definition at line 39 of file zero_adjoints.hpp.
|
inline |
Zero the adjoints of the varis of every var in an Eigen::Matrix container.
Recursively call zero_adjoints on the rest of the arguments.
| T | type of current argument |
| Pargs | type of rest of arguments |
| x | current argument |
| args | rest of arguments to zero |
Definition at line 52 of file zero_adjoints.hpp.
|
inline |
Zero the adjoints of every element in a vector.
Recursively call zero_adjoints on the rest of the arguments.
| T | type of current argument |
| Pargs | type of rest of arguments |
| x | current argument |
| args | rest of arguments to zero |
Definition at line 69 of file zero_adjoints.hpp.
|
inline |
Return an array of zeros.
| K | size of the array |
| std::domain_error | if K is negative. |
Definition at line 17 of file zeros_array.hpp.
|
inline |
Return an integer array of zeros.
| K | size of the array |
| std::domain_error | if K is negative. |
Definition at line 17 of file zeros_int_array.hpp.
|
inline |
Return a row vector of zeros.
| K | size of the row vector |
| std::domain_error | if K is negative. |
Definition at line 17 of file zeros_row_vector.hpp.
|
inline |
Return a vector of zeros.
| K | size of the vector |
| std::domain_error | if K is negative. |
Definition at line 17 of file zeros_vector.hpp.
| const double stan::math::CONSTRAINT_TOLERANCE = 1E-8 |
The tolerance for checking arithmetic bounds in rank and in simplexes.
The default value is 1E-8.
Definition at line 12 of file constraint_tolerance.hpp.
|
static |
Smallest positive value.
Definition at line 41 of file constants.hpp.
|
static |
The value of half the natural logarithm 2, \( \log(2) / 2 \).
Definition at line 175 of file constants.hpp.
| const double stan::math::HALF_LOG_TWO_PI = 0.5 * LOG_TWO_PI |
The value of half the natural logarithm \( 2\pi \), \( \log(2\pi) / 2 \).
Definition at line 181 of file constants.hpp.
|
static |
Positive infinity.
Definition at line 46 of file constants.hpp.
|
static |
The value of 1 over the square root of \( \pi \), \( 1 / \sqrt{\pi} \).
Definition at line 155 of file constants.hpp.
|
static |
The value of 1 over the square root of 2, \( 1 / \sqrt{2} \).
Definition at line 148 of file constants.hpp.
|
static |
The value of 1 over the square root of \( 2\pi \), \( 1 / \sqrt{2\pi} \).
Definition at line 162 of file constants.hpp.
| constexpr double stan::math::lgamma_stirling_diff_useful = 10 |
Definition at line 18 of file lgamma_stirling_diff.hpp.
| const double stan::math::LOG_EPSILON = std::log(EPSILON) |
The natural logarithm of machine precision \( \epsilon \), \( \log \epsilon \).
Definition at line 74 of file constants.hpp.
|
static |
The natural logarithm of 0.5, \( \log 0.5 = \log 1 - \log 2 \).
Definition at line 92 of file constants.hpp.
| const double stan::math::LOG_PI = std::log(pi()) |
The natural logarithm of \( \pi \), \( \log \pi \).
Definition at line 80 of file constants.hpp.
| const double stan::math::LOG_PI_OVER_FOUR = 0.25 * LOG_PI |
The value of one quarter the natural logarithm of \( \pi \), \( \log(\pi) / 4 \).
Definition at line 104 of file constants.hpp.
| const double stan::math::LOG_SQRT_PI = std::log(boost::math::constants::root_pi<double>()) |
The natural logarithm of the square root of \( \pi \), \( \log(sqrt{\pi}) \).
Definition at line 110 of file constants.hpp.
|
static |
The natural logarithm of 10, \( \log 10 \).
Definition at line 116 of file constants.hpp.
|
static |
The natural logarithm of 2, \( \log 2 \).
Definition at line 86 of file constants.hpp.
The natural logarithm of 2 plus the natural logarithm of \( \pi \), \( \log(2\pi) \).
Definition at line 98 of file constants.hpp.
|
static |
The natural logarithm of 0, \( \log 0 \).
Definition at line 68 of file constants.hpp.
| const std::string stan::math::MAJOR_VERSION = "4" |
Major version number for Stan math library.
Definition at line 22 of file version.hpp.
| const std::string stan::math::MINOR_VERSION = "2" |
Minor version number for Stan math library.
Definition at line 25 of file version.hpp.
| const double stan::math::NEG_LOG_SQRT_TWO_PI = -std::log(SQRT_TWO_PI) |
The value of minus the natural logarithm of the square root of \( 2\pi \), \( -\log(\sqrt{2\pi}) \).
Definition at line 187 of file constants.hpp.
|
static |
Negative infinity.
Definition at line 51 of file constants.hpp.
|
static |
(Quiet) not-a-number value.
Definition at line 56 of file constants.hpp.
Definition at line 435 of file opencl_context.hpp.
| const std::string stan::math::PATCH_VERSION = "1" |
Patch version for Stan math library.
Definition at line 28 of file version.hpp.
| const double stan::math::POISSON_MAX_RATE = std::pow(2.0, 30) |
Largest rate parameter allowed in Poisson RNG.
Definition at line 192 of file constants.hpp.
|
static |
The value of the square root of \( \pi \), \( \sqrt{\pi} \).
Definition at line 128 of file constants.hpp.
|
static |
The value of the square root of 2, \( \sqrt{2} \).
Definition at line 122 of file constants.hpp.
The square root of 2 divided by the square root of \( \pi \), \( \sqrt{2} / \sqrt{\pi} \).
Definition at line 141 of file constants.hpp.
|
static |
The value of the square root of \( 2\pi \), \( \sqrt{2\pi} \).
Definition at line 135 of file constants.hpp.
|
static |
The value of 2 over the square root of \( \pi \), \( 2 / \sqrt{\pi} \).
Definition at line 169 of file constants.hpp.
|
static |
Twice the value of \( \pi \), \( 2\pi \).
Definition at line 62 of file constants.hpp.